mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-02-22 01:00:25 +00:00
9 lines
264 B
Python
9 lines
264 B
Python
|
# 讀取文件
|
||
|
with open('input.txt', 'r') as file:
|
||
|
content = file.read()
|
||
|
print("文件內容:", content)
|
||
|
|
||
|
# 寫入文件
|
||
|
with open('output.txt', 'w') as file:
|
||
|
file.write("這是寫入的新內容。")
|
||
|
print("內容已寫入output.txt")s
|