rename.py 990 B

1234567891011121314151617181920212223242526272829303132
  1. import os, sys
  2. import shutil
  3. model_name="1"
  4. if_sampling="True"
  5. fitness_func="all"
  6. error_count_file_name = "error_count_"+model_name+"_"+if_sampling+"_"+fitness_func+".csv"
  7. src = "./" + error_count_file_name
  8. dest = "./ga_output/" + error_count_file_name
  9. print("************************************************************************************")
  10. print(src)
  11. shutil.copy("./error_count.csv", src)
  12. if os.path.exists(dest):
  13. os.remove(dest)
  14. shutil.move(src, dest)
  15. entropy_file_name = "entropy_"+model_name+"_"+if_sampling+"_"+fitness_func+".csv"
  16. src = "./" + entropy_file_name
  17. dest = "./ga_output/entropy/" + entropy_file_name
  18. shutil.copy("./entropy.txt", src)
  19. if os.path.exists(dest):
  20. os.remove(dest)
  21. shutil.move(src, dest)
  22. r_list_file_name = "r_list_"+model_name+"_"+if_sampling+"_"+fitness_func+".csv"
  23. src = "./" + r_list_file_name
  24. dest = "./ga_output/r_list" + r_list_file_name
  25. shutil.copy("./r_list.csv",src)
  26. if os.path.exists(dest):
  27. os.remove(dest)
  28. shutil.move(src, dest)