StackOverflow 文件 Python Language 教程 檔案和資料夾 IO 將一個檔案的內容複製到另一個檔案 將一個檔案的內容複製到另一個檔案 Created: November-22, 2018 placeholderCopywith open(input_file, 'r') as in_file, open(output_file, 'w') as out_file: for line in in_file: out_file.write(line) 使用 shutil 模組: placeholderCopyimport shutil shutil.copyfile(src, dst) 複製目錄樹隨機檔案訪問使用 mmap