Problem getting a file pathname with tkFileDialog

Eric Brunel eric_brunel at despammed.com
Thu Nov 9 03:14:10 EST 2006


On Wed, 08 Nov 2006 20:01:08 +0100, <cdroulers at hotmail.com> wrote:

> Hello,
> I am working on a school project that requires me to get the path of a
> filename for future treatment.
> I've tried getting a file with tkFileDialog.askopenfile.
>
>
> ********************************************
> import tkFileDialog
> file = tkFileDialog.askopenfile()
> print 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?

Use tkFileDialog.askopenfilename?

HTH
-- 
python -c "print ''.join([chr(154 - ord(c)) for c in  
'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"



More information about the Python-list mailing list