Lv.1
欢迎协作
在 如何永久保存变量? 中回复
import os
if not os.path.exists('data.txt'):
with open('data.txt','w') as f:
f.write('写入的信息')
#解码
with open('data.txt', 'r', encoding='utf-8') as f:
data = f.read().splitlines()
print(data)2024-05-16T17:55:52 点赞:0