Skip to content

Instantly share code, notes, and snippets.

@gmic
Created April 5, 2017 09:20
Show Gist options
  • Save gmic/c62c8fd5ccc286c5e31d3f77f2663529 to your computer and use it in GitHub Desktop.
Save gmic/c62c8fd5ccc286c5e31d3f77f2663529 to your computer and use it in GitHub Desktop.
Pipe subprocess to output file
my_cmd = ['cat'] + input_files
with open('myfile', "w") as outfile:
subprocess.call(my_cmd, stdout=outfile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment