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

J

Joey C.

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.
 
S

Steve Holden

Joey said:
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.
After you've had the user interact with the dialog you should call its
GetFileName() method. The interactive interpreter can be useful in
finding things like this out (though many details of objects can remain
hidden in the Windows environment):
['GetFileExt', 'GetFileName', 'GetFileTitle', 'GetPathName',
'GetPathNames', 'GetReadOnlyPref', 'SetOFNInitialDir', 'SetOFNTitle']
regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top