“File duplikat Python” Kode Jawaban

File duplikat Python

>>> import shutil
>>> # Copy the file in same folder with different name
>>> shutil.copy('original.txt', 'duplicate.txt')
'/home/username/duplicate.txt'
>>> shutil.copy('original.txt', 'my_folder/duplicate.txt')
'/home/username/my_folder/duplicate.txt'
Annoyed Alligator

Salin file dalam python3

import shutil

original = r'original path where the file is currently stored\file name.file extension'
target = r'target path where the file will be copied\file name.file extension'

shutil.copyfile(original, target)
XeN0N

Jawaban yang mirip dengan “File duplikat Python”

Pertanyaan yang mirip dengan “File duplikat Python”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya