My secret to high uptime:
while True:
try:
main()
except:
pass
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
My secret to high uptime:
while True:
try:
main()
except:
pass
If you're on Linux (or Mac), add an alias to your .bashrc:
alias activate="source env/bin/activate"
Now you can activate your venv by just running activate
in the project root!
Not necessarily a trick that's always useful but I always forget this.
You can get async REPL by calling python -m asyncio
.
Also, old trick - in need of simple http server serving static files?
python -m http.server
Using http.server
is my go-to sanity check method if my configured my network firewall correctly or not.
Don't need to activate your venv to use it.
Just use venv/bin/python my-file.py
from a script or a terminal from your project root.
You don't need to use venv at all, break the mold and do it all global