python: question about files in Python.

Tim Peters tim.one at comcast.net
Sat Feb 15 19:22:44 EST 2003


> with the file object generated by file('some_file_name', 'w') is it
> possible to get the file name from one of the file object's attributes?

In an interactive shell, and where f is such a file object, try dir(f).  The
attribute whose name is 'name' may be suggestive <wink>.






More information about the Python-list mailing list