Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subprocess_mem_only-0.10.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

subprocess_mem_only-0.10-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page