I have a python script which I would like to run in the background. So I do this:  $ nohup python script.py &If I am frequently making changes to the script, I need to terminate the process and run the script again.$ kill -9 <pid_of_bg_process>$ nohup python script.py &Is is possible to reload the process without terminating it?
How to reload a background process?
process;background process
Short answer - no.Long answer: You are actually calling a python interpreter. That interpreter loads the script.py and parses it.If you change the script it has to reload the file and start from the beginning, since the interpreter has no way to know which part was changed.Now if your goal is to simply signal python to reload/restart the script, you can wrap it into a shell-script:#!/bin/shLINE=python script.pystop(){  pkill -f $LINE}clean(){  stop  exit 0}trap stop 1trap clean 9 15while true  do    $LINE &    waitdoneYou can now start that shell-script (in background, with nohup, if you like).If you send a HUP signal to it, it will restart your python process.If you kill the wrapper process the python script will terminate, too.I did not test my script - but the idea should be clear.