Skip to content

Instantly share code, notes, and snippets.

@chadcooper
Created July 1, 2013 20:52
Show Gist options
  • Save chadcooper/5904534 to your computer and use it in GitHub Desktop.
Save chadcooper/5904534 to your computer and use it in GitHub Desktop.
Super simple file picker jobbie.
import wx
class MyForm(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "File Picker")
self.panel = wx.Panel(self, wx.ID_ANY)
box = wx.BoxSizer(wx.SB_VERTICAL)
self.file_picker = wx.FilePickerCtrl(self.panel, -1)
box.Add(self.file_picker, 0, wx.EXPAND)
self.panel.SetSizer(box)
self.Bind(wx.EVT_FILEPICKER_CHANGED, self.change_current, self.file_picker)
def change_current(self, event):
filename = self.file_picker.GetPath()
print filename
if __name__ == "__main__":
app = wx.App(False)
frame = MyForm()
frame.Show()
app.MainLoop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment