Skip to content
Custom command for Input functions
Profile icon
[deleted]

Heya, I'm trying to make an application in Python. Do you know how I can make it so, if someone types /exit in any input, it shuts down? I already know how to make it shut down by using the os package...

import os os.system('exit')

All I need to do is add that "command" for all inputs. I just need a simpler way instead of adding "if input = "\exit" then os.system('exit')" all the time.

Any help is appreacited!

You are viewing a single comment. View All
Answered by Coder100 [earned 5 cycles]
View Answer
Profile icon
Coder100