File size: 1,048 Bytes
2acfed7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
import os
import shutil
# Define the file names to move
files_to_move = [
"new_tools.parquet",
"new_fpmmTrades.parquet",
"fpmms.parquet",
"fpmmTrades.parquet",
]
# Get the current working directory
current_dir = os.getcwd()
# Define source and destination paths
source_dir = os.path.join(current_dir, "data")
dest_dir = os.path.join(current_dir, "tmp")
def move_files():
# Create tmp directory if it doesn't exist
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
# Move each file
for file_name in files_to_move:
source_file = os.path.join(source_dir, file_name)
dest_file = os.path.join(dest_dir, file_name)
try:
if os.path.exists(source_file):
shutil.move(source_file, dest_file)
print(f"Moved {file_name} successfully")
else:
print(f"File not found: {file_name}")
except Exception as e:
print(f"Error moving {file_name}: {str(e)}")
if __name__ == "__main__":
move_files()
|