Get file name from file handle

Noprianto noprianto at gmail.com
Tue Feb 17 03:28:13 EST 2009


On 2/17/09, loial <jldunn2000 at googlemail.com> wrote:
>
> Is there anyway, having been passed a file handle, to get the
> filename?
>
> I am assuming not, but thought I would ask


>>> a = open('/etc/passwd')
>>> a.name
'/etc/passwd'
>>>

Best regards,
Nop
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090217/c1a907b4/attachment-0001.html>


More information about the Python-list mailing list