Welcome, guest | Sign In | My Account | Store | Cart

This windows batch script uses python and py2exe to create a single, distributable .exe of your python code.

Python, 23 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@echo off
rem = """

py25 -x "%~f0" 
goto endofPython """

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

sys.argv += ['py2exe', '-b1', '-d./']

setup(
    # use "console = " for console-based apps
    windows=["cron.py"],
    zipfile=None
    )

shutil.rmtree('build')
os.remove('w9xpopen.exe')
rem = """
:endofPython """
Created by Chris Somerlot on Mon, 31 Mar 2008 (PSF)
Python recipes (4591)
Chris Somerlot's recipes (1)

Required Modules

  • (none specified)

Other Information and Tasks