View Full Version : file dialog
giancamati
06-27-2006, 07:19 AM
Hello everybody, I am new to vizard. I wonder if exists a method to open a file dialog box which permits to navigate in the directories structure and choose the wrf to open.
Thank you so much
giancarlo :D
Gladsomebeast
06-27-2006, 09:37 AM
Because Vizard is a python interpriter, you can use python libraries to do this. Check the web for python based methods.
tobin
06-27-2006, 11:30 PM
Vizard comes standard with pythonwin's win32api, win32gui, and win32ui modules. To do what you're looking for, simply:
import win32ui
inFileDlg = win32ui.CreateFileDialog(1, '', 'foo.txt')
inFileDlg.DoModal()
outFileDlg = win32ui.CreateFileDialog(0, '', 'foo.doc')
outFileDlg.DoModal()
inFileName = inFileDlg.GetPathName()
outFileName = outFileDlg.GetPathName()
print inFileName
print outFileName
You can find more detailed doc on the win32ui methods here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.3/pywin32/win32ui.html
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.