1

I got a Button and when the Button was tapped it runs a function. Till here I got everything ready. And now my question I will close the program correct like in the title. Is in Python anything like in Java the platform.exit() function? Hope you can help.

closed as off-topic by Ghanima Dec 9 '18 at 19:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Ghanima
If this question can be reworded to fit the rules in the help center, please edit the question.

1
import sys
sys.exit(0)

Or to set a bad exit code

import sys
sys.exit(2)

Or with a message

import sys
sys.exit('something very bad went wrong')

Not the answer you're looking for? Browse other questions tagged or ask your own question.