Skip to content

Instantly share code, notes, and snippets.

@akisatok
Created August 21, 2017 18:57
Show Gist options
  • Save akisatok/e4254d21de24f9c8a6cbf1743d3769f2 to your computer and use it in GitHub Desktop.
Save akisatok/e4254d21de24f9c8a6cbf1743d3769f2 to your computer and use it in GitHub Desktop.
Pythonからコマンドを呼び出す(Windows編) ref: http://qiita.com/_akisato/items/d97b17064df158f0dea0
import subprocess
cmd = 'myprogram myargs'
returncode = subprocess.call(cmd)
import subprocess
cmd = 'myprogram myargs'
returncode = subprocess.Popen(cmd)
import subprocess
cmd = 'dir .'
returncode = subprocess.Popen(cmd, shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment