Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 python 程序,可以将一些信息传递给一个站点进行解析。它不工作,但我不知道为什么。有没有办法将诊断信息放在将打印到日志的某些地方?
您可以使用 python日志记录来编写日志文件。
import logging logging.basicConfig(filename='example.log',level=logging.DEBUG) logging.debug('This message should go to the log file')