sys.exit()

Ivan Voras ivoras at fer.hr
Thu Oct 9 09:11:30 EDT 2003


In a code such as:

if len(sys.argv) < 2:
    print "I need arguments!"
    sys.exit(1)

Is sys.exit() really a good choice? Is there something more elegant? (I
tried return but it is valid only in a function)


-- 
-- 
Every sufficiently advanced magic is indistinguishable from technology
   - Arthur C Anticlarke






More information about the Python-list mailing list