I have to VPN and then ssh from home to my work server and want to run a python script in the background, then log out of the ssh session. My script makes several histogram
If you are running on a *nix OS the problem is your session is terminated and all processes requiring a session are also terminated when you disconnect. More specifically all your processes are sent a SIGHUP (signal hang-up). The default handling of SITHUP is to terminate the process. If you want you script to continue it needs to ignore the signal. The easiest way to do that assuming you start your script via the command line it to run it using the nohup command:
nohup python scriptToRun.py << start>& logfile.log&
nohup normally sends standard out and standard error to the file nohup.out in the current directory. Since you're redirecting already output nohup.out will not be created.