Skip to content

Instantly share code, notes, and snippets.

@walison17
Last active July 1, 2020 18:58
Show Gist options
  • Save walison17/a51d96e5c369bd7f7fb02929dcac4cef to your computer and use it in GitHub Desktop.
Save walison17/a51d96e5c369bd7f7fb02929dcac4cef to your computer and use it in GitHub Desktop.
import shutil
from pathlib import Path
FILENAMES_TXT = Path("/home/walison/arquivos.txt")
SRC = Path("/home/walison/")
DEST = Path("/home/walison/arquivos-copiados/")
if not DEST.exists():
DEST.mkdir(parents=True)
with FILENAMES_TXT.open("r") as filenames:
for filename in filenames:
shutil.copy(SRC / filename.strip("\n"), DEST)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment