Get filename using filefialog.askfilename

cheirasacan at gmail.com cheirasacan at gmail.com
Tue May 7 16:27:59 EDT 2013


Well. It's driving me crazy. So simple....

I use:

file = filedialog.askopenfile ( mode....... )

to open a file with an open dialog box, OK. Made it.

How i get the name of the opened file?

i do :

print(file)

the output is: <......name="file.doc"...mode=......encoding..........  >

How can i get the second member of 'file'?

I had prove with print(file[1]) and print(file(1)) but does not work.

And i am unable to find a detailed reference to this object in the i.net

http://fossies.org/dox/Python-3.3.1/filedialog_8py_source.html#l00393 is
where i could reach!



Thanks




More information about the Python-list mailing list