Using win32ui.CreateFileDialog() to get the name of a file.

Joey C. joeyjwc at gmail.com
Sat Nov 19 11:27:19 EST 2005


Hello.
I'm writing a program that creates a series of batch operations to
convert movies to be used on iPodLinux.  The programs that do the
encoding and conversions are seperate from mine and all mine does is
use os.system() to call the program.

However, it needs to get an input file and an output file.  Originally
I was using just raw input, but I got adventuresome and decided to try
win32ui.CreateFileDialog().  But this will only open or save a file and
its output will be either 1 or a failure.  How might I go about using
it to get the _file name_ of a file.
For example.
Box appears asking user to find a file they want.  They double click on
the file.  Let's call it C:\Video.avi
Then another dialog box appears asking them where to save it.  They
save it at C:\iPodVideo.avi.

Now the Python program extracts the name of these files and then uses
os.system() to run:
mencoder.exe -[parameters] C:\Video.avi -o C:\iPodVideo.avi

Note that I'm not actually inputting the contents of the file, I'm just
passing the file name along.

How might I do this?  Thanks.




More information about the Python-list mailing list