Advertisement
rfmonk

subprocess_popen_write.py

Jan 31st, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. # this is from The Python
  4. # Standard Library by example
  5. # ISBN13: 9780321767349
  6.  
  7. import subprocess
  8.  
  9. print 'write:'
  10. proc = subprocess.Popen(['cat', '-'],
  11.                         stdin=subprocess.PIPE,
  12.                         )
  13. proc.communicate('\tstdin: to stdin\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement