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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file subprocess_mem_only-0.10.tar.gz.
File metadata
- Download URL: subprocess_mem_only-0.10.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14ff43884931c2f35f1bcc275639ab0b2275f5575add42a52e3325ada57afef2
|
|
| MD5 |
4c67bfe23f9d46a135321a603848f6b4
|
|
| BLAKE2b-256 |
2b0e826acc546f5950a1d26326c77fba34535b3bc1877b174489b541b8318c20
|
File details
Details for the file subprocess_mem_only-0.10-py3-none-any.whl.
File metadata
- Download URL: subprocess_mem_only-0.10-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a60e25e60bf992f6ae5733a30d20984035158ff7a32d3d9551a4409ec0fa81c
|
|
| MD5 |
4f637cefa58e5711661671d7f82c2001
|
|
| BLAKE2b-256 |
0b487c08bbe3784a3b2ac75a1c039d6f7b240b26cb895301d6d6ddc88048fc5c
|