问题描述:

My environment:

Windows 10 x64 with

Python 3.4.4 [MSC v.1600 32 bit (Intel)] on win32

There is a simple Python script c:\demo\script.py that operates on files in c:\demo\html\ folder.

There is setup.py file used with py2exe:

from distutils.core import setup

import py2exe

from glob import glob

data_files = [("html", glob(r".\html\*.*"))]

# data_files = [("html", ["c:/demo/html/index.html"])]

py2exe_options = dict(

optimize=2,

compressed=True,

bundle_files=1,

dist_dir='dist1',

)

setup(name="name",

data_files=data_files,

windows=[{'script' : "script.py"}],

zipfile=None,

options={"py2exe": py2exe_options},

)

I want data_files to be bundled into .exe file (when "zipfile=None" is used) or to a zipfile otherwise.

For some reasons data_files are never bundled in both cases.

c:\demo\html with it's content are just being copied to c:\demo\dist1\html while standard Python libs and interpreter are successfully bundled to .exe or .zip file depending on the config.

What is wrong with data_files? How to bundle them successfully?

相关阅读:
Top