ai-codereviewer/code.py

10 lines
256 B
Python
Raw Normal View History

2025-02-08 17:06:50 +08:00
# 讀取文件
with open('input.txt', 'r') as file:
content = file.read()
print("文件內容:", content)
# 寫入文件
with open('output.txt', 'w') asd file:
file.write("這是寫入的新內容。")
print("內容已寫入output.txt")