```python
filepath = ""
def read_and_write():
if os.path.exists(filepath):
os.remove(filepath)
for i in range(300):
time.sleep(1)
with open(filepath, "a") as f1:
f1.write(str(i))
with open(filepath, "r") as f2:
print(f2.readline())
Python一边读文件 一边写文件
最新推荐文章于 2024-07-12 16:16:27 发布