Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import subprocess
- p = subprocess.Popen(["./test.sh"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
- out, err = p.communicate(input='1')
- print (out)
- ################################################################################
- Traceback (most recent call last):
- File "/home/petya/eclipse/python3/sybprocess1.py", line 6, in <module>
- out, err = p.communicate(input='1')
- File "/usr/lib/python3.5/subprocess.py", line 801, in communicate
- stdout, stderr = self._communicate(input, endtime, timeout)
- File "/usr/lib/python3.5/subprocess.py", line 1431, in _communicate
- input_view = memoryview(self._input)
- TypeError: memoryview: a bytes-like object is required, not 'str'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement