Guest User

Freezing script

a guest
Jun 21st, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.94 KB | None | 0 0
  1. import sys
  2. import os
  3. from cx_Freeze import setup, Executable
  4. import scipy
  5.  
  6. scipy_path = os.path.dirname(scipy.__file__) #use this if you are also using scipy in your application
  7.  
  8. build_exe_options = {"packages": ["pyface.ui.wx", "tvtk.vtk_module", "tvtk.pyface.ui.wx", "matplotlib.backends.backend_tkagg"],
  9.                      "excludes": ['numarray', 'IPython', 'collections.abc'],
  10.                      "include_files": [("C:\\Python27\\Lib\\site-packages\\tvtk\\pyface\\images\\", "tvtk\\pyface\\images"),
  11.                                        ("C:\\Python27\\Lib\\site-packages\\pyface\\images\\", "pyface\\images"),
  12.                                        ("C:\\Python27\\Lib\\site-packages\\tvtk\\plugins\\scene\\preferences.ini", "tvtk\\plugins\\scene\\preferences.ini"),
  13.                                        ("C:\\Python27\\Lib\\site-packages\\tvtk\\tvtk_classes.zip", "tvtk\\tvtk_classes.zip"),
  14.                                        ("C:\\Python27\\Lib\\site-packages\\mayavi\\core\\lut\\pylab_luts.pkl","mayavi\\core\\lut\\pylab_luts.pkl"),
  15.                                        ("C:\\Python27\\Lib\\site-packages\\mayavi\\preferences\\preferences.ini","mayavi\\preferences\\preferences.ini"),
  16.                                        ("C:\\Python27\\Lib\\site-packages\\numpy\\core\\libifcoremd.dll","numpy\\core\\libifcoremd.dll"),
  17.                                        ("C:\\Python27\\Lib\\site-packages\\numpy\\core\\libmmd.dll","numpy\\core\\libmmd.dll"),
  18.                                        (str(scipy_path), "scipy") #for scipy
  19.                                        ]                      
  20.                      ,"create_shared_zip": False #to avoid creating library.zip
  21.                      }
  22.  
  23. executables = [
  24.     Executable('test2.py', targetName="test2.exe", base=None)
  25. ]
  26.  
  27. setup(name='myfile',
  28.       version='1.0',
  29.       description='myfile',
  30.       options = {"build_exe": build_exe_options},
  31.       executables=executables
  32.       )
Add Comment
Please, Sign In to add comment