1

Normally when one want to exit an interactive session in Python, one can use exit() or quit(), but that does not work on Windows embeddable Python, why?

specifically it does not work on Python 3.10.4 Windows embeddable package, link https://www.python.org/ftp/python/3.10.4/python-3.10.4-embed-amd64.zip

screenshot: enter image description here

  • the only way i've found to actually exit it is Ctrl+Z+Enter.. .exit / .quit / Ctrl+D doesn't work either, but Ctrl+Z+Enter actually works.

  • notably the windows-embed version (where quit() doesn't work) is only 8.1MB, while the full installer version is 27.1MB

hanshenrik
  • 19,904
  • 4
  • 43
  • 89

1 Answers1

1

You could do the following with the Windows embeddable:

import sys
sys.quit()

You can read more about this in a more detailed answer here.

vikjam
  • 525
  • 3
  • 9