Conversation
Notices
-
Embed this notice
kaia (kaia@brotka.st)'s status on Tuesday, 12-Dec-2023 18:35:03 JST kaia if you use sys.exit (1) in Python and forget importing sys, the program will still do what you wanted :blobcatthinksmart: -
Embed this notice
Astenix :neofox_snug: (astenix@blob.cat)'s status on Tuesday, 12-Dec-2023 18:41:06 JST Astenix :neofox_snug: @kaia exit(1) 🧠
kaia likes this. -
Embed this notice
Miander (mian@berserker.town)'s status on Tuesday, 12-Dec-2023 19:06:20 JST Miander @kaia
For absolutely no reason I prefer using raise SystemExit(1).kaia likes this. -
Embed this notice
aZa (aza1905@mastodon.social)'s status on Tuesday, 12-Dec-2023 19:07:35 JST aZa @kaia because sys.exit() is imported at runtime.
You can call exit() at any time in the program.
Without that you also wouldnt be able to exit the Python shell.kaia likes this.
-
Embed this notice