fix: file input with subprocess
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import subprocess
|
||||
|
||||
|
||||
def run_command(command, stdout=None, stderr=None):
|
||||
def run_command(command, stdout=None, stdin=None, stderr=None):
|
||||
stdout = stdout or subprocess.PIPE
|
||||
stderr = stderr or subprocess.PIPE
|
||||
process = subprocess.Popen(command, stdout=stdout, stderr=stderr)
|
||||
process = subprocess.Popen(command, stdout=stdout, stdin=stdin, stderr=stderr)
|
||||
out, error = process.communicate()
|
||||
if process.returncode:
|
||||
print("Something went wrong:")
|
||||
|
||||
Reference in New Issue
Block a user