How to quietly exit a runfile script?Python

Python-Programme
Anonymous
 How to quietly exit a runfile script?

Post by Anonymous »

I am using Spyder 6 console to invoke a Python script via the runfile command. After a recent Anaconda update, I found that sys.exit() no longer exits the script quietly. It prints:

Code: Select all

An exception has occurred, use %tb to see the full traceback.

SystemExit: 0

C:\Users\User.Name\AppData\Local\anaconda3\envs\py39\lib\site-packages\IPython\core\interactiveshell.py:3534: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
Verwenden von exit () und befreit () sind gleich ausführlich. Ich möchte os._exit () vermeiden, da es Säuberungshandler überspringt.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post