file.py 475 B

1234567891011121314151617
  1. import win32ui
  2. import shutil
  3. import os
  4. current_path = os.getcwd()
  5. print(current_path)
  6. def copy_file(src_path, dst_path):
  7. shutil.copy(src_path, dst_path)
  8. dlg = win32ui.CreateFileDialog(1) # 参数 1 表示打开文件对话框
  9. dlg.SetOFNInitialDir('C://') # 设置打开文件对话框中的初始显示目录
  10. dlg.DoModal()
  11. filename = dlg.GetPathName()
  12. print(filename)
  13. if filename is not None and filename != "":
  14. copy_file(filename, current_path + "/license.txt")