标签: python-3.x discord
我用discord.py制作机器人并且需要一个日志记录系统,我的机器人已经将错误输出到日志文件,但我希望它将打印到控制台的任何内容输出到文本文件中。
E.g:
This is being printed to the console
And I want it to do this
答案 0 :(得分:0)
您可以执行此链接
with open("file","a") as f: #place all your codes in this block print("hello",file=f)