I want to quit interpreter when -i is passed in. eg
> python -i test.py
yeah
SystemExit
>>>
I want to quit interpreter. my test.py
import sys
print 'yeah'
sys.tracebacklimit = 0
sys.exit()
I have tried exit() and quit(), but I am still in the interpreter. The reason I want to do this is because I have a script from mayapy( autodesk maya python interpreter ), which launches like this
mayapy -i myscript.py [args], I want to quit interpreter when --help is passed as argument, but it always stays in interpreter because -i is passed in.
Is there a way to have the same effect as ctrl+d ?