The following is the code. When I run, I got an error message, saying that \"name exit is not defined\". Could anyone tell me why? Thanks very much for your time and attent
You need to import sys first, since exit (and argv) is in that module.
import sys
exit
argv
The error I get when I run your code is:
File "", line 1, in NameError: name 'sys' is not defined
which is complaining about sys.argv instead of exit. But in either case, the solution -- import sys is the same.
sys.argv