looking for a better way to call a file.

Eric_Dexter at msn.com Eric_Dexter at msn.com
Sun Dec 31 22:49:00 EST 2006


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.
>
> Eric_Dexter at 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




More information about the Python-list mailing list