Skip to content

Instantly share code, notes, and snippets.

@jrosco
Last active March 9, 2025 10:05
Show Gist options
  • Save jrosco/d01b28c2f37100bb5278 to your computer and use it in GitHub Desktop.
Save jrosco/d01b28c2f37100bb5278 to your computer and use it in GitHub Desktop.
Restart running python program from inside app
#!/usr/bin/env python
import sys
import os
def restart_program():
"""Restarts the current program.
Note: this function does not return. Any cleanup action (like
saving data) must be done before calling this function."""
python = sys.executable
os.execl(python, python, * sys.argv)
if __name__ == "__main__":
answer = raw_input("Do you want to restart this program ? ")
if answer.lower().strip() in "y yes".split():
restart_program()
@CristopherGrant
Copy link

When you have the secrets to survive in a match, the ability to think and strategy to win uno online is always an extremely important factor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment