[Tkinter-discuss] Easy way to get a file explorer?

Guilherme Polo ggpolo at gmail.com
Thu Jun 12 21:45:21 CEST 2008


On Thu, Jun 12, 2008 at 4:36 PM, Alexnb <alexnbryan at gmail.com> wrote:
>
> Thanks, this is exactly what I am looking for, but I can't find much useful
> documentation on it. So I want to have it give me a string of the path of
> the file they selected, which seems simple, but I am having issues. for
> example:
>
> path = tkFileDialog.askopenfile()
> print path
>
> it prints this:
>
> <open file 'C:/Documents and Settings/Alex/My Documents/My
> Music/101-u2-instant_karma.mp3', mode 'r' at 0x00C3EE78>
>
> but all I want is the actual path. So how can I do that?
>

use askopenfilename instead.

> Kevin Walzer-5 wrote:
>>
>> Alexnb wrote:
>>> Okay, so in the small app I am creating I want to have a button that
>>> activates a file explorer and then once the user selects a file I want to
>>> be
>>> able to get the path of that file. Is there a way to do this without
>>> going
>>> into serious detail? and if not could someone point me in the right
>>> direction? I am open to about anything. Thanks.
>>
>> tkFileDialog is what you're looking for.
>>
>> --
>> Kevin Walzer
>> Code by Kevin
>> http://www.codebykevin.com
>> _______________________________________________
>> Tkinter-discuss mailing list
>> Tkinter-discuss at python.org
>> http://mail.python.org/mailman/listinfo/tkinter-discuss
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Easy-way-to-get-a-file-explorer--tp17806393p17808068.html
> Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>



-- 
-- Guilherme H. Polo Goncalves


More information about the Tkinter-discuss mailing list