#πŸ”’ Programmatically exiting python interpreter mode

12 messages Β· Page 1 of 1 (latest)

robust swift
#

This one's kind of hard to google, so I'm asking here.

I'm running a script (on Windows command line, but I'm not sure it matters) with python -i main.py. If I use quit() in the script, it exits me out into the interpreter mode. My question is: is there some sort of 'higher level' of quit() that causes it to exit from the interpreter entirely? Yes, I'm aware I can just drop the -i flag, but having both capabilities available would be useful to me.

void palmBOT
#

@robust swift

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

cobalt herald
#

what -i does

smoky olive
#

this terminates the whole process instead of exiting the python program gracefully

#

so it skips the -i introspection afterwards

robust swift
#

oho, thank you!

#

?solved

#

er

#

!solved

void palmBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.