使用 python 获取当前时间, 并在记事本中显示,方便复制
from datetime import datetime
import os
from datetime import datetime
time = datetime.now().strftime('%Y%m%d%H%M%S')
with open('time.txt', 'w+') as f:
print('现在的时间是:\n' + time, file = f)
os.system('notepad time.txt')
os.system('del /q time.txt')
效果