| | import os |
| | import shutil |
| |
|
| | def move_non_npz_files(source_folder, destination_folder): |
| | |
| | if not os.path.exists(destination_folder): |
| | os.makedirs(destination_folder) |
| |
|
| | |
| | for filename in os.listdir(source_folder): |
| | |
| | source_file_path = os.path.join(source_folder, filename) |
| |
|
| | |
| | if os.path.isfile(source_file_path) and not filename.endswith('.npz'): |
| | |
| | destination_file_path = os.path.join(destination_folder, filename) |
| |
|
| | |
| | shutil.move(source_file_path, destination_file_path) |
| | print(f'Moved: {filename} to {destination_folder}') |
| |
|
| | |
| | source_folder = '/path/to/source/folder' |
| | destination_folder = '/path/to/destination/folder' |
| |
|
| | |
| | move_non_npz_files(source_folder, destination_folder) |
| |
|