Home > Net >  Can I edit the copy of the python script a process is running?
Can I edit the copy of the python script a process is running?

Time:08-10

I've started running a Python script that takes about 3 days to finish. My understanding is that Linux processes make a copy of a python script at the time they're created, so further edits on the file won't impact the running process.

However, I just realized I've made a mistake on the code and the processes running for over 2 days are going to crash. Is it possible to edit the copy of the python script the process loaded?

I'm basically trying to figure out if there's a way to fix the mistake I've made without having to restart the script execution.

CodePudding user response:

No, you can't. The interpreter byte compiles your source code when it initially reads it. Updating the file won't change the byte code that is running.

  • Related