Re: last line chopped from input file

2005-08-21 Thread Jeff Schwab
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", "

Re: last line chopped from input file

2005-08-21 Thread gene tani
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

Re: last line chopped from input file

2005-08-21 Thread Eric Lavigne
> > 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

Re: last line chopped from input file

2005-08-21 Thread Alan Kemp
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: '

Re: last line chopped from input file

2005-08-21 Thread Eric Lavigne
>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.

Re: last line chopped from input file

2005-08-21 Thread phil hunt
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'

last line chopped from input file

2005-08-20 Thread Eric Lavigne
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')