Skip to content
← Back to Community
How do i restart?? PYTHON
Profile icon
Ekashrejaiswal

How can we make a program restart base on the user inputs can anybody tell me how to do it on PYTHON

Voters
Profile icon
Ekashrejaiswal
Comments
hotnewtop
Profile icon
Coder100
import sys sys.exit(1)

And to have it restart, you also need to create a .replit file:

run="while [ true ]; do; python main.py: done"
Profile icon
BotologE

@Coder100, i got error from the run command:

> while [ true ]; do; python main.py: done sh: 1: Syntax error: ";" unexpected exit status 2
Profile icon
Coder100

while [ true ] do; python main.py; done @BotologE