test2.py 678 B

123456789101112131415161718
  1. import os
  2. import shutil
  3. default_download_folder = os.path.join(os.path.expanduser('~'), 'Downloads')
  4. download_folder = os.path.normpath(os.path.join(os.path.dirname(__file__), 'downloads'))
  5. os.makedirs(download_folder, exist_ok=True)
  6. file_path = os.path.join(download_folder, 'output.wav')
  7. if os.path.exists(download_folder):
  8. destination_path = os.path.join(download_folder, 'output.wav')
  9. try:
  10. # shutil.move(file_path, destination_path)
  11. # print(f"文件已移動到: {destination_path}")
  12. print(file_path)
  13. except Exception as e:
  14. print(f"移動文件時出錯: {e}")
  15. else:
  16. print(f"文件不存在: {file_path}")