Linked Questions
19 questions linked to/from Restart python-script from within itself
0 votes
0 answers
186 views
Start script from beginning after executed (python) Help please [duplicate]
it's me again! xD I was wondering around some forums trying to find an answer to yesterday's question... And well i added the LAST 4 LINES OF CODE code to mine and i realised it kinda worked, the only ...
51 votes
8 answers
49k views
Restarting a self-updating python script
I have written a script that will keep itself up to date by downloading the latest version from a website and overwriting the running script. I am not sure what the best way to restart the script ...
30 votes
6 answers
152k views
How to make a script automatically restart itself?
How do you make a python program automatically restart itself? So let's say there is a really simple program like: var = input("Hi! I like cheese! Do you like cheese?").lower() if var == &...
10 votes
7 answers
30k views
How to restart a python script after it finishes
I have a python script that will be running that basically collects data and inserts it into a database based on the last time the database was updated. Basically, i want this script to keep running ...
6 votes
2 answers
13k views
Automatically restart a Python program if it's killed
I run a Python Discord bot. I import some modules and have some events. Now and then, it seems like the script gets killed for some unknown reason. Maybe because of an error/exception or some ...
2 votes
3 answers
8k views
How do I set up a Raspberry Pi 3 B+ to Auto Deploy updates to a private Github Repo?
I bought a Pi 3 B+ and would like to have it auto clone/deploy new pushes (from a different machine) from a private github repo. I was just wondering how I would do that. I know I need a github web ...
5 votes
1 answer
2k views
Schedule python script restart or object re init with new parameters
I have a program that will run 24/7 getting frames from a camera, doing processing and sending .jpg images via local network. Generally, I don't want any saving of video to file, however I might want ...
0 votes
2 answers
3k views
Python: Restart script and exit it after function does not work
After a run, the user is asked whether he wants to end the programme [with sys.exit()] or restart it [os.system('main.py')]. If he restarts the programme, the programme will run through until he can ...
-1 votes
1 answer
3k views
Restart script instead of turning it off when error happens in python selenium
I have this python selenium script that after few minutes always throws some kind of error. Usually because chrome runs out of memory or there is some problem with proxy, but other errors also so its ...
0 votes
2 answers
2k views
Restart Python Code after restarting the server
I have a Python code running on Spyder on our server which needs to run constantly. However, from time to time our server breaks and it is restarted. Unfortunately, my code stops running as well and I ...
1 vote
2 answers
1k views
How do I restart a python app from within the app itself
Got a Django app that has users going through a setup wizard. After the wizard, the app needs to restart for it to pick the necessary settings. The app is run on Ubuntu 18.04 and monitored using ...
1 vote
1 answer
606 views
ERROR:root:'Process' object has no attribute 'get_open_files'
Running the code below associated with the answer of @s3ni0r here using python 3.8 import os import sys import psutil import logging def restart_program(): """Restarts the current ...
1 vote
0 answers
420 views
Using pythonnet, is it possible to reload a DLL?
I'm running: python 3.7.9 (64-bit) pythonnet 2.4.0 ... and I have the following problem: I have a bunch of DLL:s, all of which implement the same interface. I want to load them, run some code and ...
0 votes
1 answer
395 views
How to have a python script restart itself in a screen session?
I have a long running python script that runs on a remote machine. I'd like to have it check if it is running in a screen session and restart itself in an attached one if not. That way I will still ...
0 votes
1 answer
288 views
Check if a file has been written in last 5 minutes, to restart if the script is stuck
I've an infinite while loop which fetches some data and writes it to a csv. Sometimes due to random reason, most likely because of memory shortage, the script gets stuck. So I've tried to restart the ...