[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] File Loader Window



disclaimer: I'm in the Python Newbie category...
 
  Thank you for the suggestion.  I installed wxPython to try it, but get a syntax error at 'file()' ? 

On Jan 20, 2008 9:24 PM, Ian Mallett <geometrian@xxxxxxxxx> wrote:
For wxPython?  Don't use the examples unless you're desperate--they're ridiculously complex.  If you do indeed want wxPython, do:

import wx
wildcard = ".AVI Audio (*.avi)|*.avi|"\
                "All files (*.*)|*.*"
def open file():
    app = wx.PySimpleApp()
    file_picker = wx.FileDialog(None,wildcard=wildcard,style= wx.FD_OPEN|wx.FD_CHANGE_DIR|wx.FD_FILE_MUST_EXIST)
    file_picker.ShowModal()
    path = file_picker.GetPath()
    app.Destroy()
    return path

Ian