Python – Is it possible to run a python file, edit it, and then run it in a second terminal

Is it possible to run a python file, edit it, and then run it in a second terminal… here is a solution to the problem.

Is it possible to run a python file, edit it, and then run it in a second terminal

I’m running a simulation (more on that later) and one of the files for this simulation is a python file with configuration details. I want to run multiple versions of this simulation, but I don’t know if running one, opening another terminal, and then editing the python file and running the second mock would break the first one. Does Python have the concept of “source code” separate from the actual process? Can I edit files safely? These simulations take a while.

(So, I’m running a gem5 simulation, and I need to run multiple versions of the simulation, changing the properties of the CPU.) Just in case. )

Solution

When you run the first instance, it will use the first Python configuration file. Then, when you run the second instance, it runs the newly updated configuration file. As long as it doesn’t run on the localhost port, it should be fine because it will try to use the same port and won’t run. If this is not the case, then it should run with the updated configuration file.

Related Problems and Solutions