Tkinter file dialog

Chris Rebert clp2 at rebertia.com
Thu May 28 23:44:38 EDT 2009


On Thu, May 28, 2009 at 7:48 PM, Ronn Ross <ronn.ross at gmail.com> wrote:
> I'm using Tkinter file selector to get a direcotry path. I'm using:
>
> self.file = tkFileDialog.askdirectory(title="Please select your directory")
>         print file
>
> but all it prints out is:
> <type 'file'>
>
> How would I print the directory path?

print self.file

Your forgot the "self." in your version. Without it, Python assumes
you're talking about built-in `file` type.

Cheers,
Chris
-- 
http://blog.rebertia.com



More information about the Python-list mailing list