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. 4 3609
Joey C. wrote: 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): dir(d)
['GetFileExt', 'GetFileName', 'GetFileTitle', 'GetPathName',
'GetPathNames', 'GetReadOnlyPref', 'SetOFNInitialDir', 'SetOFNTitle'] d.Show()
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
Joey C. wrote: 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): dir(d)
['GetFileExt', 'GetFileName', 'GetFileTitle', 'GetPathName',
'GetPathNames', 'GetReadOnlyPref', 'SetOFNInitialDir', 'SetOFNTitle'] d.Show()
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
Okay, thank you. This worked very well.
Okay, thank you. This worked very well. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Me Mine |
last post by:
i,
I have trying to code a small console app that will
allow a user to select a window and then create a
screen capture of the window. I haven't been able to
figure out how to do the screen...
|
by: Serge Guay |
last post by:
I have been trying to print a text file to my printer but the most I have
been able to do is print one line. I have been using the following commands.
dc = win32ui.CreateDC()...
|
by: EricP |
last post by:
I get the following error when I run this script to open a file dialog.
I've searched the web and news groups for this issue and have not found any
references. I get the same behavior when I run...
|
by: Darcy Kahle |
last post by:
I am trying to do some advanced printing in python using the win32ui
module, and have run into an issue. I need to print a page landscape.
As I could not determine how to specify the orientation...
|
by: MsKitty |
last post by:
My client is used to clicking on the script name on her PC and getting
a windows command line box which it runs in. Not fancy but did the job
until recently...
Now it can take up to 4 minutes...
|
by: Chris Lambacher |
last post by:
Hi,
This question has come up a few times on the list with no one giving a public
answer. How do you use CreatePrintDialog from win32ui?
About a year ago someone posted that:
dlg =...
|
by: Joakim Persson |
last post by:
Hello all. I am involved in a project where we have a desire to
improve our software testing tools, and I'm in charge of looking for
solutions regarding the logging of our software (originating...
|
by: Joey C. |
last post by:
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...
|
by: robert |
last post by:
As soon as I install wxPython on a Py2.3.5, my win32ui / win32gui apps
freak out. buttons in dialogs are magically pressed. backgrounds of
dialogs are colored wrong...
this is with current...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |