Spyder修改模板template.py日期格式

时间:2021-01-26 15:52:15

标签: python templates anaconda spyder

编辑器Spyder自带一个默认的模板文件template.py,当你创建一个新的py文件时,它会显示日期参数“%(date)s”。 如何将日期格式更改为以下方法“年-月-日小时:分钟:秒”格式或其他我喜欢的格式?

1 个答案:

答案 0 :(得分:0)

从 Spyder 存储库中的 the discussion of this issue 来看,date 似乎是“在 editor.py 中硬编码,因此您必须更改 Spyder 代码”。您可以更改 spyder/spyder/plugins/editor.py 中的第 1901 行以根据需要设置日期格式。

'date': time.ctime()

相关问题