installable package #9

Merged
dan merged 31 commits from installable into dev 2023-12-07 11:32:03 +01:00
Showing only changes of commit cb37e4b023 - Show all commits

View file

@ -0,0 +1,17 @@
import os
import subprocess
# Set an environment variable in the parent process
os.environ["PARENT_VARIABLE"] = "12345s"
# Spawn a subprocess and modify the environment variable
subprocess.run(
[
"python",
"-c",
"import os; print('b', os.environ['PARENT_VARIABLE']); os.environ['PARENT_VARIABLE'] = 'modified_value'; print('c', os.environ['PARENT_VARIABLE'])",
]
)
# Check if the modification in the subprocess affected the parent process
print("a", os.environ["PARENT_VARIABLE"]) # This will print 'parent_value', not 'modified_value'