Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Help running Python Script in the background automatically.
- ajsya
- Scratcher
1000+ posts
Help running Python Script in the background automatically.
So, I'm trying to host a python program on my Raspberry Pi 4 running Ubuntu server in the background without having to start it manually. I've tried a couple of possible solutions before landing on this guide that seemed to work well at first. The problem is that it keeps stopping after a few hours for no obvious reason. Here's the output that I've received:
If anyone could explain to me why this is happening and what I can do to fix it please let me know. All help is appreciated, thanks!
● scratchmc.service - The Scratch Minecraft Server Directory
Loaded: loaded (/lib/systemd/system/scratchmc.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2022-04-27 06:35:33 UTC; 1 day 18h ago
Process: 5236 ExecStart=/home/ubuntu/Coding Files/Python Files/ScratchMCServerDirectory/env/bin/python /home/ubuntu/C>
Main PID: 5236 (code=exited, status=0/SUCCESS)
Apr 27 06:35:33 ubuntu python[5236]: ☁ playersample
Apr 27 06:35:33 ubuntu python[5236]: ☁ request
Apr 27 06:35:33 ubuntu python[5236]: Response sent!
Apr 27 06:35:33 ubuntu python[5236]: ☁ playersample
Apr 27 06:35:33 ubuntu systemd[1]: scratchmc.service: Succeeded.
If anyone could explain to me why this is happening and what I can do to fix it please let me know. All help is appreciated, thanks!
- Sid72020123
- Scratcher
500+ posts
Help running Python Script in the background automatically.
You can use online IDEs like Replit and a pinging service to keep it alive 24/7
Last edited by Sid72020123 (April 29, 2022 14:45:50)
Sid72020123
- Chiroyce
- Scratcher
1000+ posts
Help running Python Script in the background automatically.
They want to run it on their on device (Raspberry Pi) so that isn't a viable solution. You can use online IDEs like Replit and a pinging service to keep it alive 24/7
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Sid72020123
- Scratcher
500+ posts
Help running Python Script in the background automatically.
Ok. I thought that an online IDE would be better because you can keep your program running 24/7 instead of PC which needs to be shut down. They can also keep it always working but that would take much power and internet.They want to run it on their on device (Raspberry Pi) so that isn't a viable solution. You can use online IDEs like Replit and a pinging service to keep it alive 24/7
Sid72020123
- Chiroyce
- Scratcher
1000+ posts
Help running Python Script in the background automatically.
Yeah that's definitely true, lower costs and maintenance and less electricity being used. but what if they want it to interact with the local network or if they have some hardware devices equipped with the Raspberry Pi? Then a cloud service won't be helpful. Ok. I thought that an online IDE would be better because you can keep your program running 24/7 instead of PC which needs to be shut down. They can also keep it always working but that would take much power and internet.
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- ajsya
- Scratcher
1000+ posts
Help running Python Script in the background automatically.
I chose not to use replit because in my experience it has been very unreliable. Also, I am already having the raspberry pi run 24/7 because it has code-server installed on it so I can program while using my managed chromebook. You can use online IDEs like Replit and a pinging service to keep it alive 24/7
- Discussion Forums
- » Advanced Topics
- » Help running Python Script in the background automatically.