os.path.isfile(path1)
示例:
def cover_files(source_dir, target_ir):
for file in os.listdir(source_dir):
source_file = os.path.join(source_dir, file)
if os.path.isfile(source_file):
shutil.copy(source_file, target_ir)
os.path.isfile(path1)
示例:
def cover_files(source_dir, target_ir):
for file in os.listdir(source_dir):
source_file = os.path.join(source_dir, file)
if os.path.isfile(source_file):
shutil.copy(source_file, target_ir)