Re: os.system error returns

2015-06-12 Thread random832
For completeness I will note that Windows is completely different. The plain exit status (1 for typical command failures) appears in the os.system result rather than a wait-encoded value. And, incidentally, an MSVC program which calls abort() will return an exit status of 3. A process that terminat

Re: os.system error returns

2015-06-12 Thread random832
On Fri, Jun 12, 2015, at 09:54, Ian Kelly wrote: > Exit code 0 traditionally means success. The exit status is two bytes, > with > the low-order byte normally containing the exit code and the high-order > byte containing the signal that caused the program to exit. That's backwards. The signal (or

Re: os.system error returns

2015-06-12 Thread Ian Kelly
On Jun 12, 2015 7:54 AM, "Ian Kelly" wrote: > > On Jun 12, 2015 7:21 AM, "Grawburg" wrote: > > > > I have a piece of code written for a Raspberry Pi with no explanation for two of the lines -- and I can't find an explanation I understand. > > > > Here are the lines: > > if os.system('modprobe --f

Re: os.system error returns

2015-06-12 Thread Grant Edwards
On 2015-06-12, Ben Finney wrote: > There is no standardisation of exit status values between different > programs. The best one can say is “exit status 0 means success”. > Anything further is specific to particular programs and is not > universal. > > You'll need to see the documentation for ‘mod

Re: os.system error returns

2015-06-12 Thread Ian Kelly
On Jun 12, 2015 7:21 AM, "Grawburg" wrote: > > I have a piece of code written for a Raspberry Pi with no explanation for two of the lines -- and I can't find an explanation I understand. > > Here are the lines: > if os.system('modprobe --first-time -q w1_gpio') ==0 > > if os.system('modprobe -q w1

Re: os.system error returns

2015-06-12 Thread Peter Otten
Grawburg wrote: > I have a piece of code written for a Raspberry Pi with no explanation for > two of the lines -- and I can't find an explanation I understand. > > Here are the lines: > if os.system('modprobe --first-time -q w1_gpio') ==0 > > if os.system('modprobe -q w1_gpio') == 256: > > >

Re: os.system error returns

2015-06-12 Thread Grant Edwards
On 2015-06-12, Grawburg wrote: > I have a piece of code written for a Raspberry Pi with no explanation for two > of the lines -- and I can't find an explanation I understand. > > Here are the lines: > if os.system('modprobe --first-time -q w1_gpio') ==0 > > if os.system('modprobe -q w1_gpio') ==

Re: os.system error returns

2015-06-12 Thread Ben Finney
Grawburg writes: > if os.system('modprobe --first-time -q w1_gpio') ==0 > > if os.system('modprobe -q w1_gpio') == 256: > > I know what the 'modprobe...' is, it's the 0 and the 256 I don't get. > Where do these numbers come from? They are integer literals, they come from the source code. The st

os.system error returns

2015-06-12 Thread Grawburg
I have a piece of code written for a Raspberry Pi with no explanation for two of the lines -- and I can't find an explanation I understand. Here are the lines: if os.system('modprobe --first-time -q w1_gpio') ==0 if os.system('modprobe -q w1_gpio') == 256: I know what the 'modprobe...' is, it

Re: OS.SYSTEM ERROR !!!

2008-09-30 Thread Michael Torrie
Blubaugh, David A. wrote: > Thank You!! > > I am still new to Python!! > > David Blubaugh As you've already noticed, plenty of folks here on the list are ready help you out with issues the crop up as you learn python. So keep on asking questions as you need assistance. In the future, please

Re: OS.SYSTEM ERROR !!!

2008-09-30 Thread Terry Reedy
Blubaugh, David A. wrote: To All, I have been attempting to execute the following program within the Python environment: Myprogram.exe, which means this is an executable file!! I would usually execute this program (with the appropriate arguments) by going to following directory within MS-DOS

RE: OS.SYSTEM ERROR !!!

2008-09-30 Thread Blubaugh, David A.
Yes, I new it was a directory issue. I am new to Python. Thank You David Blubaugh -Original Message- From: Martin Walsh [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2008 1:42 PM To: python-list@python.org Subject: Re: OS.SYSTEM ERROR !!! Blubaugh, David A. wrote: >

RE: OS.SYSTEM ERROR !!!

2008-09-30 Thread Blubaugh, David A.
Thank You!! I am still new to Python!! David Blubaugh -Original Message- From: Christian Heimes [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2008 2:08 PM To: python-list@python.org Subject: Re: OS.SYSTEM ERROR !!! Blubaugh, David A. wrote: > To All, > >

Re: OS.SYSTEM ERROR !!!

2008-09-30 Thread Christian Heimes
[EMAIL PROTECTED] wrote: I would add the following line right before your call to os.system: os.chdir(r'C:\myprogramfolder\run') I wouldn't. os.chdir() tends to introduce all sorts of trouble. It's a quick n'dirty hack for a small script but no solution for a large program or library. Chri

Re: OS.SYSTEM ERROR !!!

2008-09-30 Thread Martin Walsh
Blubaugh, David A. wrote: > To All, > > I have been attempting to execute the following program within the > Python environment: > > However, when I would try to execute the following lines of source code > within a python script file: > > import os > > os.system(r"C:\myprogramfolder\run\Mypr

Re: OS.SYSTEM ERROR !!!

2008-09-30 Thread Christian Heimes
Blubaugh, David A. wrote: To All, I have been attempting to execute the following program within the Python environment: Myprogram.exe, which means this is an executable file!! I would usually execute this program (with the appropriate arguments) by going to following directory within MS-DOS

Re: OS.SYSTEM ERROR !!!

2008-09-30 Thread giltay
On Sep 30, 1:21 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > I would usually execute this program (with the appropriate arguments) by > going to following directory within MS-DOS (Windows XP): > > C:\myprogramfolder\run> Myprogram.exe 1 1 acc 0 [snip] > import os > > os.system(r"C:\myprogr

Re: OS.SYSTEM ERROR !!!

2008-09-30 Thread Carsten Haese
Blubaugh, David A. wrote: > To All, > > > I have been attempting to execute the following program within the > Python environment: > > Myprogram.exe, which means this is an executable file!! > > I would usually execute this program (with the appropriate arguments) by > going to following direc

OS.SYSTEM ERROR !!!

2008-09-30 Thread Blubaugh, David A.
To All, I have been attempting to execute the following program within the Python environment: Myprogram.exe, which means this is an executable file!! I would usually execute this program (with the appropriate arguments) by going to following directory within MS-DOS (Windows XP): C:\myprogram