Exemplo de setup.py:
1 from distutils.core import setup
2 import py2exe
3 import sys
4 import glob
5 import os
6
7 # If run without args, build executables, in quiet mode.
8 if len(sys.argv) == 1:
9 sys.argv.append("py2exe")
10 sys.argv.append("-q")
11
12
13 datafiles = []
14 # i18n
15 def walk_callback(args, dirname, fnames):
16 hasfile = False
17 for f in fnames:
18 if os.path.isfile(os.path.join(dirname, f)):
19 hasfile = True
20 break
21 if hasfile:
22 datafiles.append((dirname,glob.glob(os.path.join(dirname, '*'))))
23
24 os.path.walk('locale', walk_callback, None)
25
26
27 setup(
28 options = {"py2exe": {"compressed": 1,
29 "optimize": 2,
30 "ascii": 1,
31 "bundle_files": 1}},
32 zipfile = None,
33 console = ["myprogram.py"],
34 data_files = datafiles
35 )