Re: os.system vs subrocess.call

2019-11-28 Thread Stephan Lukits
> On 28. Nov 2019, at 12:05, Ulrich Goebel wrote: > > Hi, > > I have to call commands from inside a python skript. These commands are in > fact other python scripts. So I made > >os.system('\.Test.py') > > That works. > > Now I tried to use > >supprocess.call(['.\', 'test.py']) [

Re: os.system vs subrocess.call

2019-11-28 Thread Pieter van Oostrum
Ulrich Goebel writes: > Hi, > > I have to call commands from inside a python skript. These commands are > in fact other python scripts. So I made > > os.system('\.Test.py') > > That works. In a string \. is the same as . So this should execute the command '.Test.py'. Is that really what you

Re: os.system vs subrocess.call

2019-11-28 Thread Ulrich Goebel
Sorry for the wrong spelling. In fact subprocess.call('./Test.py') works. The raising error was my error too, using ['./', 'Test.py'] instead of './Test.py' Sorry... Am 28.11.19 um 11:05 schrieb Ulrich Goebel: Hi, I have to call commands from inside a python skript. These commands are

Re: os.system vs subrocess.call

2019-11-28 Thread Peter Otten
Ulrich Goebel wrote: > Hi, > > I have to call commands from inside a python skript. These commands are > in fact other python scripts. So I made > > os.system('\.Test.py') > > That works. > > Now I tried to use > > supprocess.call(['.\', 'test.py']) Remember to use cut and paste fo

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

Re: os.system() with imbeded quotes on centos

2013-04-05 Thread Cameron Simpson
On 05Apr2013 16:36, Chris Rebert wrote: | No need for third-party code, just use the std lib: | http://docs.python.org/2/library/pipes.html#pipes.quote | http://docs.python.org/3/library/shlex.html#shlex.quote Ah, handy. I must say its quote quoting is kind of verbose, though. | (But yeah, best

Re: os.system() with imbeded quotes on centos

2013-04-05 Thread Chris Rebert
On Fri, Apr 5, 2013 at 3:00 PM, Cameron Simpson wrote: > On 01Apr2013 20:26, John Gordon wrote: > | In <0c9717ca-52dd-49ce-8102-e14328838...@googlegroups.com> cev...@gmail.com > writes: > | > someip = '192.168.01.01' > | > var1 = 'lynx -dump http://' + someip + > '/cgi-bin/.log&.submit=+++G

Re: os.system() with imbeded quotes on centos

2013-04-05 Thread Cameron Simpson
On 01Apr2013 20:26, John Gordon wrote: | In <0c9717ca-52dd-49ce-8102-e14328838...@googlegroups.com> cev...@gmail.com writes: | > someip = '192.168.01.01' | > var1 = 'lynx -dump http://' + someip + '/cgi-bin/.log&.submit=+++Go%21+++ > junk' | | '&' is a special character in shell commands.

Re: os.system() with imbeded quotes on centos

2013-04-01 Thread John Gordon
In <0c9717ca-52dd-49ce-8102-e14328838...@googlegroups.com> cev...@gmail.com writes: > someip = '192.168.01.01' > var1 = 'lynx -dump http://' + someip + '/cgi-bin/.log&.submit=+++Go%21+++ > > junk' '&' is a special character in shell commands. You'll need to quote or escape it. Try this:

Re: os.system() with imbeded quotes on centos

2013-04-01 Thread Chris Angelico
On Tue, Apr 2, 2013 at 6:22 AM, wrote: > var1 = 'lynx -dump http://' + someip + '/cgi-bin/.log&.submit=+++Go%21+++ > > junk' > lynx -dump 'http://192.168.01.01/cgi-bin/.log&.submit=+++Go%21+++ > junk' The problem is the &, which splits the command. Note how your manual execution puts

Re: os.system() not responding on django... any reason?

2013-03-01 Thread Mark Lawrence
On 01/03/2013 16:23, Jaiky wrote: it is running in view.. When replying can you please ensure we have the complete context, otherwise we have to spend time looking, thanks. -- Cheers. Mark Lawrence -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system() not responding on django... any reason?

2013-03-01 Thread Jaiky
in django inviroment.. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system() not responding on django... any reason?

2013-03-01 Thread Jaiky
it is running in view.. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system() not responding on django... any reason?

2013-03-01 Thread mar...@python.net
On Fri, Mar 1, 2013, at 09:24 AM, Roy Smith wrote: > In article <4fcc93b7-3be9-416f-a2d4-bdc6cba21...@googlegroups.com>, > Jaiky wrote: > > [a lot of code involving ssh and paramiko] > > Here's a few general suggestions: > > 1) Try to reduce this to the smallest possible amount of code which

Re: os.system() not responding on django... any reason?

2013-03-01 Thread Roy Smith
In article <4fcc93b7-3be9-416f-a2d4-bdc6cba21...@googlegroups.com>, Jaiky wrote: [a lot of code involving ssh and paramiko] Here's a few general suggestions: 1) Try to reduce this to the smallest possible amount of code which demonstrates the problem. You gave us a page full of complicated s

Re: os.system and subprocess odd behavior

2012-12-18 Thread Cameron Simpson
On 18Dec2012 05:39, Dave Angel wrote: | On 12/18/2012 05:27 AM, Hans Mulder wrote: | > On 18/12/12 06:10:43, photonym...@gmail.com wrote: | >> I hope I understand the question... but shouldn't you wait for the process to complete before exiting? | >> | >> Something like: | >> | >> pid = subproces

Re: os.system and subprocess odd behavior

2012-12-18 Thread Hans Mulder
On 17/12/12 21:56:50, py_genetic wrote: > /usr/local/Calpont/mysql/bin/mysql > --defaults-file=/usr/local/Calpont/mysql/my.cnf -u root myDB < > /home/myusr/jobs/APP_JOBS/JOB_XXX.SQL > /home/myusr/jobs/APP_JOBS/JOB_XXX.TXT If you're trying to interact with a MySQL database, then you should really

Re: os.system and subprocess odd behavior

2012-12-18 Thread py_genetic
Solved the issue, by injecting the query into the cmd line. Shell script worked fine as if I was cutting and pasting to the prompt. Seems to still be something with the subprocess receiving and exit code before or when the query finishes, just when I ask to to read from the .SQL file. example

Re: os.system and subprocess odd behavior

2012-12-18 Thread Oscar Benjamin
Can you trim content and interleave your response (instead of top-posting) please? On 18 December 2012 18:26, py_genetic wrote: > HOWEVER... > > when using this command from before no dice > > /usr/local/Calpont/mysql/bin/mysql > --defaults-file=/usr/local/Calpont/mysql/my.cnf -u root myDB <

Re: os.system and subprocess odd behavior

2012-12-18 Thread py_genetic
Oscar I can confirm this behavior from terminal. AND this works as well, simulating exactly what I'm doing permissions wise, and calling sudo python test.py below f1 = open('TESTDIR/file1.txt', 'w') f1.write('some test here\n') f1.close() cmd1 = 'cat < TESTDIR/file1.txt > TESTDIR/file2.txt' P

Re: os.system and subprocess odd behavior

2012-12-18 Thread Hans Mulder
On 18/12/12 11:39:56, Dave Angel wrote: > On 12/18/2012 05:27 AM, Hans Mulder wrote: >> On 18/12/12 06:10:43, photonym...@gmail.com wrote: >>> I hope I understand the question... but shouldn't you wait for the process >>> to complete before exiting? >>> >>> Something like: >>> >>> pid = subprocess

Re: os.system and subprocess odd behavior

2012-12-18 Thread Dave Angel
On 12/18/2012 05:27 AM, Hans Mulder wrote: > On 18/12/12 06:10:43, photonym...@gmail.com wrote: >> I hope I understand the question... but shouldn't you wait for the process >> to complete before exiting? >> >> Something like: >> >> pid = subprocess.Popen(...) >> pid.wait() >> >> Otherwise, it'll

Re: os.system and subprocess odd behavior

2012-12-18 Thread Hans Mulder
On 18/12/12 06:10:43, photonym...@gmail.com wrote: > I hope I understand the question... but shouldn't you wait for the process to > complete before exiting? > > Something like: > > pid = subprocess.Popen(...) > pid.wait() > > Otherwise, it'll exit before the background process is done. Why w

Re: os.system and subprocess odd behavior

2012-12-17 Thread photonymous
I hope I understand the question... but shouldn't you wait for the process to complete before exiting? Something like: pid = subprocess.Popen(...) pid.wait() Otherwise, it'll exit before the background process is done. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system and subprocess odd behavior

2012-12-17 Thread Oscar Benjamin
On 17 December 2012 20:56, py_genetic wrote: > Oscar, seems you may be correct. I need to run this program as a superuser. > However, after some more tests with simple commands... I seem to be working > correctly from any permission level in python Except for the output write > command f

Re: os.system and subprocess odd behavior

2012-12-17 Thread py_genetic
Oscar, seems you may be correct. I need to run this program as a superuser. However, after some more tests with simple commands... I seem to be working correctly from any permission level in python Except for the output write command from the database to a file. Which runs fine if I past

Re: os.system and subprocess odd behavior

2012-12-17 Thread Oscar Benjamin
On 17 December 2012 16:39, py_genetic wrote: > Thanks for verifying this for me Steven. I'm glad you are seeing it work. > It's really the strangest thing. > > The issue seems to be with the " > outfile.txt" portion of the command. > > The actual command is running a query on a verticalDB and d

Re: os.system and subprocess odd behavior

2012-12-17 Thread py_genetic
Thanks for verifying this for me Steven. I'm glad you are seeing it work. It's really the strangest thing. The issue seems to be with the " > outfile.txt" portion of the command. The actual command is running a query on a verticalDB and dumping the result. The EXACT command run from the comm

Re: os.system and subprocess odd behavior

2012-12-17 Thread py_genetic
Thanks! I am using .txt extensions. Sorry for being a little vague. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system and subprocess odd behavior

2012-12-14 Thread Dieter Maurer
py_genetic writes: > Example of the issue for arguments sake: > > Platform Ubuntu server 12.04LTS, python 2.7 > > Say file1.txt has "hello world" in it. ^ Here, you speak of "file1.txt" (note the extension ".txt") > subprocess.Popen("cat < file1 > file2", shell = True) > subprocess

Re: os.system and subprocess odd behavior

2012-12-14 Thread Steven D'Aprano
On Fri, 14 Dec 2012 10:13:38 -0800, py_genetic wrote: > Example of the issue for arguments sake: > > Platform Ubuntu server 12.04LTS, python 2.7 > > Say file1.txt has "hello world" in it. > > subprocess.Popen("cat < file1 > file2", shell = True) > subprocess.call("cat < file1 > file2", shell =

Re: os.system()

2012-04-20 Thread Adam Skutt
On Apr 20, 6:51 am, Yigit Turgut wrote: > On Apr 19, 11:02 pm, "Steve" wrote: > > > > "Yigit Turgut" wrote in message > > >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... > > > When I use os.system() function, script waits for termination of the > > > windows that is ope

Re: os.system()

2012-04-20 Thread Chris Angelico
On Fri, Apr 20, 2012 at 8:51 PM, Yigit Turgut wrote: > On Apr 19, 11:02 pm, "Steve" wrote: >> > "Yigit Turgut"  wrote in message >> >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... >> > When I use os.system() function, script waits for termination of the >> >> windows tha

Re: os.system()

2012-04-20 Thread Yigit Turgut
On Apr 19, 11:02 pm, "Steve" wrote: > > "Yigit Turgut"  wrote in message > >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... > > When I use os.system() function, script waits for termination of the > > windows that is opened by os.system() to continue thus throwing errors >

Re: os.system()

2012-04-19 Thread Steve
"Yigit Turgut" wrote in message news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... When I use os.system() function, script waits for termination of the windows that is opened by os.system() to continue thus throwing errors and etc. How can i tell Python to let it go and

Re: os.system()

2012-04-19 Thread Jacob MacDonald
On Thursday, April 19, 2012 11:09:22 AM UTC-7, Yigit Turgut wrote: > When I use os.system() function, script waits for termination of the > windows that is opened by os.system() to continue thus throwing errors > and etc. How can i tell Python to let it go and keep on with the next > execution afte

Re: os.system()

2012-04-19 Thread MRAB
On 19/04/2012 19:09, Yigit Turgut wrote: When I use os.system() function, script waits for termination of the windows that is opened by os.system() to continue thus throwing errors and etc. How can i tell Python to let it go and keep on with the next execution after os.system() ? Try using the

Re: os.system() on Windows in Tkinter app spawns console window

2011-08-14 Thread Kevin Walzer
On 8/13/11 1:15 AM, Nobody wrote: On Fri, 12 Aug 2011 22:49:32 -0400, Kevin Walzer wrote: I'm developing a Tkinter app for a Windows customer, and the app bundles several command-line tools (ported from Unix). I call out to these console tools from the Tkinter app via os.system(). However, in t

Re: os.system() on Windows in Tkinter app spawns console window

2011-08-12 Thread Nobody
On Fri, 12 Aug 2011 22:49:32 -0400, Kevin Walzer wrote: > I'm developing a Tkinter app for a Windows customer, and the app bundles > several command-line tools (ported from Unix). I call out to these > console tools from the Tkinter app via os.system(). However, in the > frozen version of my ap

Re: os.system and loggers

2011-01-11 Thread Tim
On Jan 10, 1:01 pm, Carl Banks wrote: > On Jan 10, 8:29 am, Tim wrote: > > > > > > > > > > > On Jan 7, 11:24 am, Tim wrote: > > > > hi, I'm using a 3rd-party python program that uses the python logging > > > facility and also makes calls to os.system. I'm trying to capture its > > > output to a

Re: os.system and loggers

2011-01-10 Thread Carl Banks
On Jan 10, 8:29 am, Tim wrote: > I think I may have included too much fluff in my original question. > The main thing I wonder is whether I can attach a log handler to > stdout in such a way that os.system calls will write to that handler > instead of the console. -- http://mail.python.org/mailma

Re: os.system and loggers

2011-01-10 Thread Carl Banks
On Jan 10, 8:29 am, Tim wrote: > On Jan 7, 11:24 am, Tim wrote: > > > > > > > hi, I'm using a 3rd-party python program that uses the python logging > > facility and also makes calls to os.system. I'm trying to capture its > > output to a file. > > > In my own code, I've taken control of the logge

Re: os.system and loggers

2011-01-10 Thread Tim
On Jan 7, 11:24 am, Tim wrote: > hi, I'm using a 3rd-party python program that uses the python logging > facility and also makes calls to os.system. I'm trying to capture its > output to a file. > > In my own code, I've taken control of the loggers that are setup in > the other program by removing

Re: os.system: string encoding

2010-06-29 Thread Lawrence D'Oliveiro
In message , Peter Kleiweg wrote: > How do I set the string encoding for os.system to anything other then > UTF-8? Works for me (on Debian Unstable): l...@theon:~> echo $LC_ALL en_NZ.utf8 l...@theon:~> python3.1 Python 3.1.2 (r312:79147, May 8 2010, 13:27:06) [GCC 4.4.4] o

Re: os.system: string encoding

2010-06-27 Thread Martin v. Loewis
>> For the moment, you can encode the string explicitly, and pass a byte >> string. > > That doesn't work I only have 3.1.2 to test at the moment. I suggest trying to use the subprocess module instead. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system: string encoding

2010-06-27 Thread Peter Kleiweg
Martin v. Loewis schreef op de 27e dag van de zomermaand van het jaar 2010: > Am 25.06.2010 17:13, schrieb Peter Kleiweg: > > How do I set the string encoding for os.system to anything other then UTF-8? > > You shouldn't have to set it, as it should use your locale's encoding. > In 3.1.2, it will

Re: os.system: string encoding

2010-06-27 Thread Martin v. Loewis
Am 25.06.2010 17:13, schrieb Peter Kleiweg: > How do I set the string encoding for os.system to anything other then UTF-8? You shouldn't have to set it, as it should use your locale's encoding. In 3.1.2, it will. For the moment, you can encode the string explicitly, and pass a byte string. Regar

Re: os.system function

2010-01-13 Thread r0g
Lie Ryan wrote: > On 01/13/10 04:59, r0g wrote: >> so you may want to look into pythons core GUI library, TKL. > > I know Tk and Tcl has been close since their childhood; did they get > married too? Whoops... yes Tk/Tcl, it seems they had become one in my head only! :) Roger. -- http://mail.py

Re: os.system function

2010-01-13 Thread Lie Ryan
On 01/13/10 04:59, r0g wrote: > so you may want to look into pythons core GUI library, TKL. I know Tk and Tcl has been close since their childhood; did they get married too? -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system function

2010-01-12 Thread r0g
Zabin wrote: > Hey everyone! > > I am a new python programmer. I am trying to get the general file > functionality with options of save and save as working. These save > functions save a folder with multiple files. Upon using the os.system > copy function- if my destination directory has files wit

Re: os.system function

2010-01-12 Thread Jeremy Sanders
Zabin wrote: > Thanks for the pointersi had a look around and found the site: > http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en- us/xcopy.mspx?mfr=true > > to disable the prompt- i needed to include /y as below: > os.system ('xcopy /s %s %s /y ' % (dirExe, dirnam

Re: os.system function

2010-01-11 Thread Zabin
On Jan 12, 11:31 am, Jeremy Sanders wrote: > Zabin wrote: > > Thanks for the pointersi had a look around and found the site: > > http://www.microsoft.com/resources/documentation/windows/xp/all/prodd... > us/xcopy.mspx?mfr=true > > > > > to disable the prompt- i needed to include /y as below: >

Re: os.system function

2010-01-11 Thread Chris Rebert
On Mon, Jan 11, 2010 at 2:00 PM, Zabin wrote: > and just wondering- whats the drawback of using os.system() command Forgetting to properly escape your input. Simple example: filename = "foo bar.txt" os.system("rm "+filename) # uh-oh, we deleted 'foo' and 'bar.txt' instead The `subprocess` modu

Re: os.system function

2010-01-11 Thread Zabin
On Jan 12, 10:23 am, Chris Rebert wrote: > On Mon, Jan 11, 2010 at 12:43 PM, Zabin wrote: > > Hey everyone! > > > I am a new python programmer. I am trying to get the general file > > functionality with options of save and save as working. These save > > functions save a folder with multiple file

Re: os.system function

2010-01-11 Thread Chris Rebert
On Mon, Jan 11, 2010 at 12:43 PM, Zabin wrote: > Hey everyone! > > I am a new python programmer. I am trying to get the general file > functionality with options of save and save as working. These save > functions save a folder with multiple files. Upon using the os.system > copy function- if my d

Re: os.system function

2010-01-11 Thread Olof Bjarnason
2010/1/11 Zabin : > Hey everyone! > > I am a new python programmer. I am trying to get the general file > functionality with options of save and save as working. These save > functions save a folder with multiple files. Upon using the os.system > copy function- if my destination directory has files

Re: os.system() question

2009-10-19 Thread Benjamin Kaplan
On Mon, Oct 19, 2009 at 2:14 PM, Bryan Irvine wrote: > I'm a python n00b and so pardon me in advance if this is really stupid > question. > > I have my suspicions but why does the following not work the way I'm > anticipating it will? > > (python 2.4.4) > import os if (os.system('echo t

Re: os.system() question

2009-10-19 Thread Chris Rebert
On Mon, Oct 19, 2009 at 11:14 AM, Bryan Irvine wrote: > I'm a python n00b and so pardon me in advance if this is really stupid > question. > > I have my suspicions but why does the following not work the way I'm > anticipating it will? > > (python 2.4.4) > import os if (os.system('echo

Re: os.system() question

2009-10-19 Thread Ethan Furman
Bryan Irvine wrote: I'm a python n00b and so pardon me in advance if this is really stupid question. I have my suspicions but why does the following not work the way I'm anticipating it will? (python 2.4.4) import os if (os.system('echo test')): ...print 'success' ... else: ...prin

RE: os.system in a service

2009-08-06 Thread Lawrence Wong
eryone. > To: python-list@python.org > From: gagsl-...@yahoo.com.ar > Subject: Re: os.system in a service > Date: Thu, 6 Aug 2009 05:35:57 -0300 > > En Thu, 06 Aug 2009 03:59:13 -0300, Diez B. Roggisch > escribió: > > Gabriel Genellina schrieb: > >> En Wed,

Re: os.system in a service

2009-08-06 Thread Gabriel Genellina
En Thu, 06 Aug 2009 03:59:13 -0300, Diez B. Roggisch escribió: Gabriel Genellina schrieb: En Wed, 05 Aug 2009 13:07:39 -0300, Lawrence Wong escribió: I wrote a program which runs a .bat file using os.system like: 'os.system(pathToBatFile)' and everything was good. Then I decided to tu

Re: os.system in a service

2009-08-06 Thread Diez B. Roggisch
Gabriel Genellina schrieb: En Wed, 05 Aug 2009 13:07:39 -0300, Lawrence Wong escribió: I wrote a program which runs a .bat file using os.system like: 'os.system(pathToBatFile)' and everything was good. Then I decided to turn my program into a service as opposed to being run with the comman

Re: os.system in a service

2009-08-05 Thread Gabriel Genellina
En Wed, 05 Aug 2009 13:07:39 -0300, Lawrence Wong escribió: I wrote a program which runs a .bat file using os.system like: 'os.system(pathToBatFile)' and everything was good. Then I decided to turn my program into a service as opposed to being run with the command prompt showing. When

Re: os.system vs subprocess

2009-06-26 Thread Nate
I ended up going with this: http://code.activestate.com/recipes/440554/ seems to feed me new lines of output atleast before the subprocess finishes, with some adjustment of the time delays. I'll guess I'll just be packing winpy into the installer. Or something. -- http://mail.python.org/mailma

Re: os.system vs subprocess

2009-06-22 Thread Tim Golden
Nate wrote: Thanks for your response. Related to this talk about shells, maybe you could point me towards a resource where I could read about how windows commands are processed w/w/o shells? I guess I assumed all subprocess commands were intepreted by the same thing, cmd.exe., or perhaps the she

Re: os.system vs subprocess

2009-06-21 Thread Lawrence D'Oliveiro
In message , Christian Heimes wrote: > The subprocess doesn't use the shell ... It can if you tell it to. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system vs subprocess

2009-06-21 Thread Christian Heimes
Nate wrote: > Thanks for your response. Related to this talk about shells, maybe you > could point me towards a resource where I could read about how windows > commands are processed w/w/o shells? I guess I assumed all subprocess > commands were intepreted by the same thing, cmd.exe., or perhaps t

Re: os.system vs subprocess

2009-06-21 Thread Nate
On Jun 21, 3:49 pm, Christian Heimes wrote: > Nate wrote: > > gmapcreator = subprocess.Popen("java -Xms128M -Xmx512M -jar > > gmapcreator.jar -dfile=censettings.xml", stdin=subprocess.PIPE, > > stdout=subprocess.PIPE, stderr=subprocess.PIPE) > > Try this: > > gmapcreator = subprocess.Popen( >    

Re: os.system vs subprocess

2009-06-21 Thread Christian Heimes
Nate wrote: > gmapcreator = subprocess.Popen("java -Xms128M -Xmx512M -jar > gmapcreator.jar -dfile=censettings.xml", stdin=subprocess.PIPE, > stdout=subprocess.PIPE, stderr=subprocess.PIPE) Try this: gmapcreator = subprocess.Popen( ["java", "-Xms128M", "-Xmx512M", "-jar", "gmapcreator.jar",

Re: os.system vs subprocess

2009-06-21 Thread Nate
On Jun 21, 2:12 pm, Chris Rebert wrote: > On Sun, Jun 21, 2009 at 10:12 AM, Nate wrote: > > I get different behavior with os.system and subprocess (no surprise > > there I guess), but I was hoping for some clarification, namely why. > > > If I type this directly into the command window: > > > java

Re: os.system vs subprocess

2009-06-21 Thread Chris Rebert
On Sun, Jun 21, 2009 at 10:12 AM, Nate wrote: > I get different behavior with os.system and subprocess (no surprise > there I guess), but I was hoping for some clarification, namely why. > > If I type this directly into the command window: > > java -Xms128M -Xmx512M -jar gmapcreator.jar -dfile=cens

Re: os.system issues

2009-02-05 Thread Chris Rebert
On Thu, Feb 5, 2009 at 6:00 AM, Youri Lammers wrote: > Ok, > > I want to run a program called 'muscle' with my python script, > muscle uses the following command: > 'muscle.exe -in filename -out filename' > so far I got: > > import os > args = ['-in filename', '-out filename'] As Christian indire

Re: os.system issues

2009-02-05 Thread Grant Edwards
On 2009-02-05, Christian Heimes wrote: > Youri Lammers schrieb: >> Ok, >> >> I want to run a program called 'muscle' with my python script, >> muscle uses the following command: >> 'muscle.exe -in filename -out filename' >> so far I got: >> >> import os >> args = ['-in filename', '-out filenam

Re: os.system issues

2009-02-05 Thread Christian Heimes
Youri Lammers schrieb: > Ok, > > I want to run a program called 'muscle' with my python script, > muscle uses the following command: > 'muscle.exe -in filename -out filename' > so far I got: > > import os > args = ['-in filename', '-out filename'] > os.system('E:\Programs\muscle\muscle.exe args

Re: os.system('cls')

2008-12-25 Thread Chris Gonnerman
Depends on what operating system you are using. The list of possible commands would be unbounded, if not truly infinite. > From: Dennis van Oosterhout [mailto:de.slotenzwem...@gmail.com] > > Hi there! I was searching for a way to clear the 'DOS screen'/command > screen etc. and found that os.s

Re: os.system('cls')

2008-12-25 Thread D'Arcy J.M. Cain
On Thu, 25 Dec 2008 13:11:09 +0100 "Dennis van Oosterhout" wrote: > Btw...does that mean that system('cls') only works on Windows...or to > say it otherwise: the program isn't platform independant? Exactly - sort of. Unless, of course, you have a program called "cls" installed on other platforms

RE: os.system('cls')

2008-12-25 Thread Barak, Ron
Hi Dennis, print dir(os.system) print os.__dict__ might help Bye, Ron. From: Dennis van Oosterhout [mailto:de.slotenzwem...@gmail.com] Sent: Thursday, December 25, 2008 12:22 To: python-list@python.org Subject: os.system('cls') Hi there! I was searching

Re: os.system('cls')

2008-12-25 Thread Python
2008/12/25 Dennis van Oosterhout : Hello Arno, thanks for the explanation! I have one more question: on the python site it says it's better to replace the system commands by subprocess and Popen. Now I searched for some good example for my specific case (as I have no idea how it should work

Re: os.system('cls')

2008-12-25 Thread Jeremiah Dodds
On Thu, Dec 25, 2008 at 7:11 AM, Dennis van Oosterhout < de.slotenzwem...@gmail.com> wrote: > Btw...does that mean that system('cls') only works on Windows...or to > say it otherwise: the program isn't platform independant? > > Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system('cls')

2008-12-25 Thread Python
On 25 dec 2008, at 12:56, Dennis van Oosterhout wrote: Hello Arno, thanks for the explanation! I have one more question: on the python site it says it's better to replace the system commands by subprocess and Popen. Now I searched for some good example for my specific case (as I have no idea h

Re: os.system('cls')

2008-12-25 Thread Python
On 25 dec 2008, at 11:22, Dennis van Oosterhout wrote: Hi there! I was searching for a way to clear the 'DOS screen'/ command screen etc. and found that os.system('cls') works for this. I was just wondering where I can find al the commands which can be used for os.system(). I searched with

Re: os.system('cls')

2008-12-25 Thread Dennis van Oosterhout
Btw...does that mean that system('cls') only works on Windows...or to say it otherwise: the program isn't platform independant? 2008/12/25 Dennis van Oosterhout : > Hello Arno, > > thanks for the explanation! I have one more question: on the python > site it says it's better to replace the system

Re: os.system('cls')

2008-12-25 Thread Dennis van Oosterhout
Hello Arno, thanks for the explanation! I have one more question: on the python site it says it's better to replace the system commands by subprocess and Popen. Now I searched for some good example for my specific case (as I have no idea how it should work and I don't get it any clearer by reading

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

Re: os.system dual behaviour

2008-09-03 Thread Emile van Sebille
iu2 wrote: Hi guys I do os.system('ls &> e') On one linux machine it emits ls output to the file e as expected. On another linux machine it emits ls to the standard output, and nothing to e! Both machines run Fedora linux. The command "ls &> e" entered at the shell (no python) behaves ok on b

  1   2   >