How do you start a program with a few acres from the piton?



  • Let's go. linux shell A program with several arguments from the pit? Probed. ossubprocess, it's not clear how to make arguments. Programme http://sourceforge.net/projects/bbmap/ ♪



  • import subprocess
    
    subprocess.check_call(['программа', 'аргумент 1', 'argument 2'])
    

    The code starts. программа of $PATH♪ giving her аргумент 1 as the first argument and argument 2 As a second argument. If программа Complete with error (not zero return code), then check_call() Discharge.

    Each element of the list is a separate argument. Shell is not clearly used because meta-symbols such as gaps do not break arguments or, for example, $a You don't screen.

    If программа that shell script, the appropriate shebang should be added, for example. #!/bin/sh at the very beginning of the file and make a violin of the performance: chmod +x программа♪ To not point the way. программа, the file should lie in one of the directors identified in $PATH variable environmentecho $PATH)




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2