Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import sys
- print "Current Python Version:: ", (sys.version)
- import subprocess
- from subprocess import check_output # <<<<<<<< error here!
- output = subprocess.check_output(['ls', '-1', '|', 'grep', 'somefile.txt'])
- print 'Have %d bytes in output' % len(output)
- print output
- [Linux]$ python myCode.py
- Current Python Version:: 2.4.3 (#1, Apr 14 2011, 20:41:59)
- [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)]
- Traceback (most recent call last):
- File "myCode.py", line 7, in ?
- from subprocess import check_output
- ImportError: cannot import name check_output
- [Linux]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement