Advertisement
python_notes

Subprocess chahnge directory & run command

Jun 2nd, 2015
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. # Changes current working directory to /bin and list the contents using the ls command in Linux
  2.  
  3. # Documentation
  4.  
  5.  
  6. subprocess.call('./ls', cwd='/bin')
  7.  
  8.  
  9.  
  10.  
  11.  
  12. .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement