3 ms·
That's because `exit` will never work in a script, but `exit()` can.
by OutOfHere 3y ago
That's because `exit` will never work in a script, but `exit()` can.
- mariocesar 3y agonote that `exit()` on a script will also not work, as the exit function is only loaded on REPL. To make it work on a script, you will need to import the sys package and later call sys.exit()
- OutOfHere 3y ago`exit()` absolutely works in a script assuming that the `site` module was not bypassed at startup via `python -S`. I understand that `sys.exit()` and others are preferred.