import glob
import shutil
dest_dir = "C:/test"
for file in glob.glob(r'C:/*.txt'):
print(file)
shutil.copy(file, dest_dir)
More Related Contents:
- How to copy files?
- Copy multiple files in Python
- how to can i go over a file twice?
- open() gives FileNotFoundError/IOError: Errno 2 No such file or directory
- How do I get the path and name of the file that is currently executing?
- How can I search sub-folders using glob.glob module? [duplicate]
- Sorting text file by using Python
- Skip first couple of lines while reading lines in Python file
- Monitoring contents of files/directories? [duplicate]
- What is the most efficient way to get first and last line of a text file?
- Do I understand os.walk right?
- How do I remove/delete a folder that is not empty?
- Writing a list to a file with Python, with newlines
- How to do virtual file processing?
- Getting file size in Python? [duplicate]
- How do I concatenate files in Python?
- whitespaces in the path of windows filepath
- How to get all of the immediate subdirectories in Python
- Easiest way to persist a data structure to a file in python?
- Python – IOError: [Errno 13] Permission denied:
- How to add a key-value to JSON data retrieved from a file?
- How does python close files that have been gc’ed?
- Why do I get “Pickle – EOFError: Ran out of input” reading an empty file?
- How do I wrap a string in a file in Python?
- Copy constructor in python?
- “TypeError: a bytes-like object is required, not ‘str'” when handling file content in Python 3
- How to make a copy of a 2D array in Python? [duplicate]
- For loop not working twice on the same file descriptor [duplicate]
- f.read coming up empty
- Fast way to copy dictionary in Python