tkFileDialog
James Stroud
jstroud at mbi.ucla.edu
Wed Nov 8 15:59:00 EST 2006
Gheorghe Postelnicu wrote:
> ---------- Forwarded message ----------
> From: cdroulers at hotmail.com
> To: python-list at python.org
> ********************************************
> import tkFileDialog
> file = tkFileDialog.askopenfile()
> print file
> ********************************************
Its ill-advised to assign to built in types (e.g. "file").
> It prints the opened files stuff, but I just can not find how to get
> that path as a string. I've searched around google and the present
> group, and found no documentation on the file class used with
> tkFileDialog. Does someone have a solution for that?
import tkFileDialog
afile = tkFileDialog.askopenfile()
print afile.name
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
More information about the Python-list
mailing list