Created
April 4, 2014 20:50
-
-
Save Hodapp87/9982871 to your computer and use it in GitHub Desktop.
subprocess with string to stdin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Will require changes (due to how strings are handled) on Python 3.x | |
import subprocess | |
f = open("test.jpg") | |
jpegString = f.read() | |
ret = subprocess.Popen(["./jpeg_check.o", "-"], stdin = subprocess.PIPE) | |
ret.communicate(jpegString) | |
print(ret.returncode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment