Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. python Configure.py
  2. python Makespec.py --onefile --windowed --upx /path/to/yourscript.py
  3. python Build.py /path/to/yourscript.spec
  4.  
  5. # -*- mode: python -*-
  6. a = Analysis([os.path.join(HOMEPATH,'support\_mountzlib.py'), os.path.join(HOMEPATH,'support\useUnicode.py'), 'r:\connection\main.py'],
  7. pathex=['C:\Documents and Settings\Lixas\Desktop\pyinstaller-1.5-rc1'])
  8.  
  9. pyz = PYZ(a.pure)
  10.  
  11. exe = EXE( pyz,
  12. a.scripts,
  13. a.binaries,
  14. a.zipfiles,
  15. a.datas,
  16. name=os.path.join('dist', 'NetworkChecker.exe'),
  17. debug=False,
  18. strip=False,
  19. upx=True,
  20. console=False,
  21. icon='r:\connection\ikona.ico' )
  22.  
  23. coll = COLLECT(
  24. exe,
  25. [('gui.glade', 'r:\connection\gui.glade', 'DATA')],
  26. [('question16.png', 'r:\connection\question16.png', 'DATA')],
  27. # a.binaries,
  28. # strip=False,
  29. upx=True,
  30. name='distFinal')
  31.  
  32. def resource_path(relative):
  33. return os.path.join(
  34. os.environ.get(
  35. "_MEIPASS2",
  36. os.path.abspath(".")
  37. ),
  38. relative
  39. )
  40.  
  41.  
  42. # in development
  43. >>> resource_path("gui.glade")
  44. "/home/shish/src/my_app/gui.glade"
  45.  
  46. # in deployment
  47. >>> resource_path("gui.glade")
  48. "/tmp/_MEI34121/gui.glade"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement