diff --git a/code.py b/code.py new file mode 100644 index 0000000..6a044bc --- /dev/null +++ b/code.py @@ -0,0 +1,9 @@ +# 讀取文件 +with open('input.txt', 'r') as file: + content = file.read() + print("文件內容:", content) + +# 寫入文件 +with open('output.txt', 'w') asd file: + file.write("這是寫入的新內容。") + print("內容已寫入output.txt") diff --git a/info.txt b/info.txt index d800886..97c400f 100644 --- a/info.txt +++ b/info.txt @@ -1 +1 @@ -123 \ No newline at end of file +123ddd \ No newline at end of file