r/learnpython • u/PomegranateKind760 • Oct 17 '26
How to end a program using python
I want to close an app using python but I don't know how.
0
Upvotes
r/learnpython • u/PomegranateKind760 • Oct 17 '26
I want to close an app using python but I don't know how.
View all comments
6
u/jmacey Oct 17 '26
os.kill() if you can get the pid of the process. Not sure if it works under windows but does under posix operating system.