Pass a variable as a SpooledTemporaryFile directly to subprocess.
Project description
Pass a variable as a SpooledTemporaryFile directly to subprocess.
$pip install subprocess-mem-only
from subprocess_mem_only import subprocess_with_spooledtempfile
var_as_binary= b'Hi there, how are you?\nYou are my best friend'
resi = subprocess_with_spooledtempfile(
command=["grep", r"\bmy\b"], content=var_as_binary
)
print(resi)
CompletedProcess(args=['grep', '\\bmy\\b'], returncode=0, stdout=b'You are my best friend\n', stderr=b'')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for subprocess_mem_only-0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a60e25e60bf992f6ae5733a30d20984035158ff7a32d3d9551a4409ec0fa81c |
|
MD5 | 4f637cefa58e5711661671d7f82c2001 |
|
BLAKE2b-256 | 0b487c08bbe3784a3b2ac75a1c039d6f7b240b26cb895301d6d6ddc88048fc5c |