xeonthread

Untitled

Jul 3rd, 2019
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. def find_qt():
  2. import os
  3.  
  4. path = os.environ['PATH']
  5.  
  6. dll_dir = os.path.dirname(__file__) + '\\Qt\\bin'
  7. if os.path.isfile(dll_dir + '\\Qt5Core.dll'):
  8. path = dll_dir + ';' + path
  9. os.environ['PATH'] = path
  10. else:
  11. for dll_dir in path.split(';'):
  12. if os.path.isfile(dll_dir + '\\Qt5Core.dll'):
  13. break
  14. else:
  15. raise ImportError("unable to find Qt5Core.dll on PATH")
  16.  
  17. try:
  18. os.add_dll_directory(dll_dir)
  19. except AttributeError:
  20. pass
  21.  
  22.  
  23. find_qt()
  24. del find_qt
Advertisement
Add Comment
Please, Sign In to add comment