Home > OS >  Python subprocess.run() batch file with updating variables
Python subprocess.run() batch file with updating variables

Time:11-29

I want to ask how can I run an external batch file while updating the variable before I run the process. The detail for my question is following:

I have a batch file right now, while it performs a simulation process. I want to write a module that I can update the variable first without manually updating the batch files, then run the simulation, and finally import the result, like:

# this will be the variable that I want to update
yyyy = 2022
mm = 11
dd = 28
Path1 = 'the path for first variable'
Path2 = 'the path for second variable'


# the batch file is like:
Batch_simulation.bat
Path 2/remote/noclear/Path 1/%yyyy%%mm%           
  • Related