GetOpenFilename from python extension

Mark Hammond mhammond at skippinet.com.au
Sun Apr 28 19:45:41 EDT 2002


neal josephson wrote:
> I have a pretty simple python program that I want to add a windows file
> dialog box to - I tried writing a python extension that called
> GetOpenFilename but it just returns a DLG_INITIALIZE (or something like
> that) error.  Has anyone managed to get this to work?
> 

It can be done with win32all.

 >>> import win32ui
 >>> d=win32ui.CreateFileDialog(1)
 >>> d.DoModal()
1
 >>> d.GetPathName()
'G:\\src\\moz_play\\mozilla\\extensions\\python\\xpcom\\server\\loader.py'
 >>>

RTFM for more info on the params etc.

Mark.




More information about the Python-list mailing list