473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

looking for a better way to call a file.

I have been auto-generating .bat files and then running
os.startfile('whatever.bat'). I don't
seem to be having much luck when I try other methods. All of a sudden
I am stuck in a
situation where I need the program that is calling to end and a new
program to start (because otherwise I get several uneeded copies).

csoundgrid4.csgrid(arrg1, """;<sco_header>""", filename)

with this by executing the main function

os3.execvp('python', 'csoundgrid4.py', arrg1, """;<sco_header>""",
filename)

and the program just ends. I would also be glad to get rid of all the
bats that I generate when I
run an external program like csound. The command line I run is
somthing like

csound play.orc play.sco

I haven't had much luck using os.startfile with arguments

Hopefully this is an easy question and any help would be apreaceated
(befour my computer gets rabies)

http://www.dexrow.com

Dec 31 '06 #1
2 1151
This probably will meet your needs:

import os
os.system("csound play.orc play.sco")

If you need more control try the subprocess module.

Er*********@msn.com wrote:
I have been auto-generating .bat files and then running
os.startfile('whatever.bat'). I don't
seem to be having much luck when I try other methods. All of a sudden
I am stuck in a
situation where I need the program that is calling to end and a new
program to start (because otherwise I get several uneeded copies).

csoundgrid4.csgrid(arrg1, """;<sco_header>""", filename)

with this by executing the main function

os3.execvp('python', 'csoundgrid4.py', arrg1, """;<sco_header>""",
filename)

and the program just ends. I would also be glad to get rid of all the
bats that I generate when I
run an external program like csound. The command line I run is
somthing like

csound play.orc play.sco

I haven't had much luck using os.startfile with arguments

Hopefully this is an easy question and any help would be apreaceated
(befour my computer gets rabies)

http://www.dexrow.com
Dec 31 '06 #2
Thanks I will give that a try.. should clean up my code quite a bit.
James Thiele wrote:
This probably will meet your needs:

import os
os.system("csound play.orc play.sco")

If you need more control try the subprocess module.

Er*********@msn.com wrote:
I have been auto-generating .bat files and then running
os.startfile('whatever.bat'). I don't
seem to be having much luck when I try other methods. All of a sudden
I am stuck in a
situation where I need the program that is calling to end and a new
program to start (because otherwise I get several uneeded copies).

csoundgrid4.csgrid(arrg1, """;<sco_header>""", filename)

with this by executing the main function

os3.execvp('python', 'csoundgrid4.py', arrg1, """;<sco_header>""",
filename)

and the program just ends. I would also be glad to get rid of all the
bats that I generate when I
run an external program like csound. The command line I run is
somthing like

csound play.orc play.sco

I haven't had much luck using os.startfile with arguments

Hopefully this is an easy question and any help would be apreaceated
(befour my computer gets rabies)

http://www.dexrow.com
Jan 1 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: klappnase | last post by:
Hello all, I am trying to internationalize my Tkinter program using gettext and encountered various problems, so it looks like it's not a trivial task. After some "research" I made up a few...
51
by: Matt | last post by:
Hello, I'm a hiring C++ developer employer looking for existing, online C++ aptitude tests. I have not yet extensively researched this yet, but as an example, I thought this test looked...
1
by: Nalaka | last post by:
Hi, I am testing with Visual studio 2005, web projects. Situation: I have one solution with two web projects, created as file system projects. (I am tesing using the built in server, not IIS)...
7
by: Bruce HS | last post by:
I'd like to call my ancestor Validation Function every time any control on a Win Form generates a Validating or Validated event. I'm using VB. I've extended Textbox, for instance, to have its...
8
by: Eric_Dexter | last post by:
I was looking for a simple way to load a simple python program from another python program. I tried os.system(cabel) The file name is cabel.py a csound instrument editor.. The error I am...
13
by: Avi | last post by:
Hi, Is there a UNIX C system command that will let me copy a file? I am looking for something similar to "cp" that can be called within a C program. I know of the "link" system call but this...
12
by: Rex | last post by:
Hello, I am a PHP newbie looking for a PHP editor I can use with a WYSIWYG interface for HTML (e.g. like Dreamweaver or Frontpage). I'm running Vista. I am having installation problems with both...
13
by: Rosario | last post by:
do you like the "GetLine_m" function i have written today? How many errors do you see? i have try only the option for to load the all file in a string not the option to load a line "\n" ended so...
11
by: magicman | last post by:
can anyone point me out to its implementation in C before I roll my own. thx
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.