РС
Size: a a a
РС
DD
РС
stdin ждёт каких-то данных?РС
DD
DD
РС
DD
DD
РС
РС
import subprocess
ENV_NAME = "base"
subprocess.run(
f"""conda init bash
conda activate {ENV_NAME}
python 'hello.py'""",
shell=True,
executable='/bin/bash',
check=True,
)
DD
DD
РС
РС

РС
import subprocess
ENV_NAME = "base"
subprocess.call(
(
"source $(conda info --root)/etc/profile.d/conda.sh"
" && conda init bash"
f" && conda activate {ENV_NAME}"
" && python hello.py"
" && conda deactivate"
),
shell=True,
executable='/bin/bash',
)
3.8.8 (default, Apr 13 2021, 19:58:26) РС
РС
DD