Py2exe - How to insert an external folder into a published exe package

I have a folder myFolder(containing some files and subfolders that are encoded in myModule.py) next to py2exe installation, and I want to paste this folder into the final published exe file as a package.

My codes in the settings file:

from distutils.core import setup
import py2exe

setup(windows=[{'script':"myModule.py",'uac_info': "requireAdministrator","icon_resources": [(1, "icon.ico")]}], options={'py2exe':{'bundle_files': 1}},zipfile = None)

Is it possible?

Python 2.7.6

+4
source share
1 answer

yes the answer above is what you want.

1.you must add foldernames to your setup file.
2.py2exe will compress and save that folders in one exe file(out come is only one exe)
3. when runnig exe.that folders will recreated automaticaly (py2exe will decompress it and put it back to computr)

in the answer above there is a link to check this .. in this link there is a function that helps you add a lot of files and folders without writing one at a time. (you only need to specify the folder name and purpose)

: : "iam.png" ---- "targetpath"

("c://targetpath","c.//currentpath/iam.png")

, py2exe

, " ",    , link..read that..

+1

All Articles