Python Forum
Subprocess use and modify inputs
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subprocess use and modify inputs
#1
Dear all,
I started python code in 2024 (a good resolution is not it ?) to use for a job project and i am currently blocked with the subprocess use.
Basically, i have to run python script (written in CPython with CPython package: numpy, scipy...) in an environnement which does not support CPython. No problem, i have a tricks : subprocess
Indeed, as you know this function allows to run a code with a specified python version for instance. There is just after my code :
import os
import subprocess
os.chdir(r"My_code_location")
Python312 = r"C:\Users...\AppData\Local\Programs\Python\Python312\python.exe"
subprocess.call([Python312,'pyNukiyama.py'])
With this code i can run my pyNukiyama.py script in my environnement which does not support this last code with python 3.12 installed on the computer. So great, it works !
However, now i need to interact with this pyNukiyama.py script to change the inputs used in this last script (basically, to perform loop with values sent in pyNukiyama.py and retrieve output values).
Thus my question how to do that ?
Maybe, modify the script pyNukiyama.py before run the subprocess with it ? Or, not use a script saved but directly the code in subprocess (pyNukiyama contains just 10 lines...) ? Any other idea ?

Thank you for your help !

Best regards,
Pierre
Reply


Messages In This Thread
Subprocess use and modify inputs - by PierreLCV - Jan-24-2024, 07:53 AM
RE: Subprocess use and modify inputs - by DeaD_EyE - Jan-24-2024, 08:46 AM
RE: Subprocess use and modify inputs - by PierreLCV - Jan-24-2024, 12:13 PM
RE: Subprocess use and modify inputs - by DeaD_EyE - Jan-26-2024, 02:31 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020