Re: execute a shell script from a python script



Thanks, actually there are no args, is there something even simpler?

Thanks
Frank


Thomas Nelson wrote:
If your script is foo.sh and takes args:
import subprocess
subprocess.call(["foo.sh","args"],shell=True)
Should work fine. check out
http://www.python.org/dev/doc/maint24/lib/module-subprocess.html

Enjoy,
THN

spec wrote:
Hi all, I know nothing about Python. What I need to do is to get a
Python script to execute a local shell script. I do not need any
output. What would be th eeasiest way to accomplish this?

Thanks!

.



Relevant Pages

  • urllib.open problem
    ... I have a python script which runs perfectly on my machine. ... on some machines and it doesnt work on other computers although they all ... have the same spec. ...
    (comp.lang.python)
  • Re: subprocess returncode windows
    ... python script to automate the deploy of ... of using a subprocess call to test the success / failure of the ... glassfish CLI tool "asadmin" ... That should solve your quoting issues on Windows and fix your code. ...
    (comp.lang.python)
  • Re: last line chopped from input file
    ... import subprocess ... In the Python script, my curve-fit program processes all except for the last line. ...
    (comp.lang.python)
  • Re: starting a client remotely
    ... Did you use SSH in a python script? ... Via subprocess, yes. ... Paramiko would be a way, ...
    (comp.lang.python)
  • Re: windows command-line
    ... my python script and agt all the returt it generates. ... Depending on python version, look into subprocess, commands or os.pipe and related. ...
    (comp.lang.python)