How to use the OS's native file selector in Tkinter

C

copx

Hi,

I would like to use the native file selector of the "host OS" for the "Open
File" function of my Python/Tkinter app. Could anyone tell me how to do
this?
My primary target platform is Windows. So a Windows-only solution would be
ok (IIRC Linux doesn't even have a "native file selector").

copx
 
J

jepler

tkFileDialog.Open is a wrapper around tk's tk_getOpenFile.

tk_getOpenFile uses the native dialog on Windows, via the GetOpenFileName()
win32 API call, at least in Tk versions 8.2 and newer.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFDHGBWJd01MZaTXX0RAl+/AJ45KwyzhjSml7tMOa2sK80++rmlYACeOYdM
bTjh0Bly9ua7cpQFhZR1q1A=
=8WQe
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top