ASPN ActiveState Programmer Network  
ActiveState, a division of Sophos
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups
Submit Recipe
My Recipes

All Recipes
All Cookbooks


View by Category

Title: Create single-file executables for windows
Submitter: Chris Somerlot (other recipes)
Last Updated: 2008/03/31
Version no: 1.0
Category: Shortcuts

 

5 stars 1 vote(s)


Description:

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

Source: Text Source

@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 """

Discussion:



Add comment

No comments.



Highest rated recipes:

1. A simple XML-RPC server

2. Web service accessible ...

3. IPy Notify

4. Changing return value ...

5. Quantum Superposition

6. Pickle objects under ...

7. Generalized delegates ...

8. Reorder a sequence (uses ...

9. Setting Win32 System ...

10. ObjectMerger




Privacy Policy | Email Opt-out | Feedback | Syndication
© 2006 ActiveState Software Inc. All rights reserved.