Python 如何屏蔽Traceback >>> aTraceback (most recent call last): File "", line 1, in aNameError: name 'a' is not defined>>> import tempfile,sys>>> sys.stderr=tempfile.TemporaryFile()>>> a>>> Python 2023-11-18 36 点赞 0 评论 54 浏览