About 202,000 results
Open links in new tab
  1. python - How do I execute a program or call a system command?

    For example: return_code = subprocess.call("echo Hello World", shell=True) subprocess.run. Python 3.5+ only. Similar to the above but even more flexible and returns a CompletedProcess …

  2. python - How do I use subprocess.check_output ()? - Stack Overflow

    Oct 17, 2024 · I want to run the following command from within a Python program: python py2.py -i test.txt I tried using subprocess.check_output as follows: py2output = …

  3. How do I create a subprocess in Python? - Stack Overflow

    Dec 20, 2010 · I would like to create a subprocess of a process. What would be a working example which shows how to accomplish this?

  4. python - Retrieving the output of subprocess.call () - Stack Overflow

    For Python 3.5 or later, it is recommended that you use the run function from the subprocess module. This returns a CompletedProcess object, from which you can easily obtain the output …

  5. How to terminate a python subprocess launched with shell=True

    Jan 25, 2011 · 460 I'm launching a subprocess with the following command: p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) However, when I try to kill …

  6. Python subprocess/Popen with a modified environment

    subprocess.Popen(my_command, env=dict(os.environ, PATH="path")) But that somewhat depends on that the replaced variables are valid python identifiers, which they most often are …

  7. Python: running subprocess in parallel - Stack Overflow

    Closed 11 years ago. I have the following code that writes the md5sums to a logfile for file in files_output: p=subprocess.Popen(['md5sum',file],stdout=logfile) p.wait() Will these be written …

  8. How to use subprocess popen Python - Stack Overflow

    Sep 26, 2012 · How to use subprocess popen Python [duplicate] Asked 13 years, 1 month ago Modified 4 years, 8 months ago Viewed 692k times

  9. subprocess - running a command as a super user from a python …

    The subprocess module takes command as a list of strings so either create a list beforehand using split () or pass the whole list later. Read the documentation for more information.

  10. python - How can I specify working directory for a subprocess

    How can I specify working directory for a subprocess Asked 15 years, 11 months ago Modified 2 years, 9 months ago Viewed 303k times