我将使用python中的tkinter制作记事本
def func_time() :
with open ('filename.txt' ,'w') as File:
time = datetime.now()
time_string = time.strftime('%m/%d/%Y')
File.write(time_string)
如果您像Windows内部记事本一样按时间/日期按钮,我希望当前的时间和日期写在记事本上。
def func_time() :
with open ('filename.txt' ,'w') as File:
time = datetime.now()
time_string = time.strftime('%m/%d/%Y')
File.write(time_string)
If you press the Time/Date button like a Windows internal notepad, I want the current time and date to be written on the notepad.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
菜单项未添加
时间/日期
。将回调修改为将datetime插入
insert
的位置。Menu item not added for
time/date
.The callback revised to insert datetime into the position of
INSERT
.