make_folder_1.py 903 B

1234567891011121314151617181920212223242526
  1. def make_folder(dealername):
  2. os.getcwd()
  3. #'C:\\Users\\corcoras\\Desktop\\FY14 INSTALLS'
  4. install_dir = 'C:\\Users\\corcoras\\Desktop\\FY14 INSTALLS'
  5. os.chdir(install_dir)
  6. #dealername = "Rene motors"
  7. dealername_no_space = dealername.replace(" ", "_")
  8. dealername_no_space
  9. #'Don_Ayres_Honda'
  10. dealer_folder = dealername_no_space[:1]
  11. dealer_folder
  12. #'D'
  13. os.chdir(dealer_folder)
  14. os.getcwd()
  15. #'C:\\Users\\corcoras\\Desktop\\FY14 INSTALLS\\D'
  16. dealername_spaces = dealername_no_space.replace("_", " ")
  17. dealername_spaces
  18. #'Don Ayres Honda'
  19. os.mkdir(dealername_spaces)
  20. os.chdir(dealername_spaces)
  21. os.getcwd()
  22. #'C:\\Users\\corcoras\\Desktop\\FY14 INSTALLS\\D\\Don Ayres Honda'
  23. os.mkdir("config")
  24. os.mkdir("original")
  25. os.mkdir("final")
  26. print(f"\nFolder was created : {install_dir}\{dealer_folder}\{dealername_spaces}")