WangGY/test/from datetime import dateti...

10 lines
270 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from datetime import datetime
today = datetime.now()
text = f"{today.year}年{today.month}月{today.day}日首次使用Git"
print(text)
# 将内容写入文本文件,方便提交到Git仓库
with open("git_note.txt", "w", encoding="utf‑8") as f:
f.write(text)