python - 从Python异常中删除路径

标签 python error-handling

我的路径很长,因此Python的错误会变得很长,因为路径总是像这样打印:

[Finished in 31.3s with exit code 4294967295]
[shell_cmd: python -u "C:\work\test.py"]
[dir: C:\work\]
[path: C:\Python27\Lib\site-packages\PyQt4; ..............]

有什么方法可以更改此行为(例如,通过更改Python源代码)以不打印路径?

最佳答案

该输出不是Python产生的。它是由Sublime build命令生成的。

根本不要在Sublime或customise the exec.py script下运行代码,以删除运行脚本后添加的调试。

关于python - 从Python异常中删除路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32413770/

相关文章:

php - PHP : How can I detect “@” in front of a call in my custom error handler?

spring-mvc - Thymeleaf错误消息优化

python - 如何在 Python 中的矩阵之间逐个元素相乘?

Python 单元测试 - 设置警告 : ResourceWarning

python - 在 Jinja2 中使用 babel 链接

spring - 使用轮询器测试直接 channel 和源的错误处理

Swift 3 更改为 NSErrorPointer?

python - nmap 和 print(nm.csv()) 需要帮助打印到 csv.file

Python 和土耳其语大写

c++ - 将 "Out of Memory"错误写入文件,没有内存?