Wednesday, May 28, 2014

Single-File Stand-alone Python 2.7.5 for Windows

If you don't want to install Python on your client.
Here is a solution :

Quote from site :

I frequently write programs in python as it is a handy, powerful language. However, sometimes I don't want to install it. There are some other projects to give a portable python implementation. That still seems too heavy for some tasks.
Here is a Windows executable form of Python 2.7.5 that contains most of the standard libraries, plus pywin32. It has the following features:
  • Single file with no dependencies besides Windows (XP or later)
  • Can run python programs (e.g., py.exe
  • Can be used as an interactive shell (e.g., py.exe, then start typing)
  • Can be used to execute string commands (e.g., py.exe -c "print 'hello world'")

I've included the very simple source code, which is nothing more than a script using py2exe. I compressed the executable using upx, which reduces its size by 12% or so and doesn't substantially slow down starting the program.

No comments:

Post a Comment