Py2exe Using a multi-file structure with multiple directories

My python project has the following structure:

+ Project -> start.py -- Main startup script -> appstate.json +> lib/ -- Directory of third-party libraries such as demjson.py, google gdata, etc. +> tools/ -- Directory of my own packages 

I cannot figure out what parameters I need to pass to py2exe in order to figure out how to do this. Can anybody help?

+4
source share
1 answer

I always used py2exe only for python modules and packages. But I expect it to work by simply inserting the setup.py file into the Project directory and running it from this directory.

setup.py

 from distutils.core import setup import py2exe import sys import os sys.argv.append('py2exe') setup(console = ['start.py'], options = {'py2exe': { }}, zipfile = None) 

Dictionary from 'py2exe': { } can be populated with some of the following parameters as needed.


The py2exe parameters that will be specified in the parameter keyword for the configuration function:

unbuffered - if true, use unbuffered binary stdout and stderr

optimize - string or int (0, 1 or 2)

contains - a list of module names to include

packages - list of packages to be included in subpackages

ignores - a list of modules to ignore if they are not found

excludes - list of module names to exclude

dll_excludes - list of dlls to exclude

dist_dir - directory where you can create the final files

typelibs - a list of generated gen_py typelibs to include (XXX text required)

0
source

Source: https://habr.com/ru/post/1382490/


All Articles