How can I use an interactive file browser in a Python script? or What's the best way to use an intera

18 Replies, 1336 Views

For cross-platform, `tkinter` is your safest bet. But if you want something prettier, `wxPython` has a solid file dialog too.

```python
import wx
app = wx.App(False)
dialog = wx.FileDialog(None, "Select a file")
if dialog.ShowModal() == wx.ID_OK:
print(dialog.GetPath())
```
A bit more code, but looks native on Mac/Win.

Messages In This Thread



Users browsing this thread: 1 Guest(s)