Eric Lavigne wrote:
> Here is a shell command (MS-DOS):
> debug\curve-fit output.txt
>
> And here is a Python script that *should* do the same thing (and almost
> does):
Python equivalent is roughly:
import os
import subprocess
subprocess.Popen([os.path.join("debug", "
or: (for long-running Win32 processes)
os.startfile(r'/relative/path/to/app')
http://docs.python.org/lib/os-process.html
under linux/BSD/solaris, i've run into situations where PATH and other
environmental var s aren't what you expect (they're from the
/etc/profile system defaults, not from your
> > import os
> > os.command("debug\\curve-fit output.txt")
> >
>
> I imagine thats was a typo for:
>
> >>> os.system("debug\\curve-fit output.txt")
>
> Alan
That fixes it. Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 21 Aug 2005 13:41:14 -0400, Eric Lavigne <[EMAIL PROTECTED]>
wrote:
>> A shorter python program would be:
>>
>> os.command("debug\\curve-fit output.txt")
>
> I tried this program:
> import os
> os.command("debug\\curve-fit output.txt")
>
> My error message is:
> AttributeError: '
>A shorter python program would be:
>
> os.command("debug\\curve-fit output.txt")
I tried this program:
import os
os.command("debug\\curve-fit output.txt")
My error message is:
AttributeError: 'module' object has no attribute 'command'
I also could not find os.command in the help files.
On 20 Aug 2005 22:53:42 -0700, Eric Lavigne <[EMAIL PROTECTED]> wrote:
>Here is a shell command (MS-DOS):
> debug\curve-fit output.txt
>
>And here is a Python script that *should* do the same thing (and almost
>does):
>
> import os
>
> inputfilename = 'input.txt'
> outputfilename = 'output.txt'
Here is a shell command (MS-DOS):
debug\curve-fit output.txt
And here is a Python script that *should* do the same thing (and almost
does):
import os
inputfilename = 'input.txt'
outputfilename = 'output.txt'
inputfile = open(inputfilename,'r')
outputfile = open(outputfilename,'w')