By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,172 Members | 762 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,172 IT Pros & Developers. It's quick & easy.

looking for a better way to call a file.

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.