随手记,别在意格式
# 读文件 with open("data.txt", "r", encoding="utf-8") as f: content = f.read() # 列表推导式 nums = [1, 2, 3, 4, 5] evens = [x for x in nums if x % 2 == 0] # JSON 操作 import json with open("data.json", "r") as f: data = json.load(f)
# 提交代码 git add . git commit -m "说明" git push # 拉取最新代码 git pull # 查看状态 git status