Compile for Windows

This one compiles a file for Windows, so you don’t need to have Python installed to run the program.

# Requires py2exe

from distutils.core import setup
import shutil
import sys
import os

import py2exe

if len(sys.argv) == 2:
    filename = sys.argv.pop()
    sys.argv.append("py2exe")
    sys.argv.append("-q")

setup(
    options = {"py2exe": {
        "compressed": 1,
        "optimize": 2,
        "ascii": 1,
        "bundle_files": 1,
        "dist_dir": os.path.dirname(filename),
        }},
    zipfile = None,
    console=[filename],
    )

shutil.rmtree("build")

raw_input()
Advertisements