tags:

views:

271

answers:

5

How do I let my friends use my Python programs? They don't have python installed, but they can use command line programs. I don't have the skill to write GUI.

Let, say I am writing some calculus calculator, with a lot of custom modules and files. How do I share it?

+10  A: 

You could use something like py2exe to convert your Python program into an executable.

musicfreak
will that convert all my modules too?
JohnWong
For the most part, yes. However, there are some that either won't work or need tinkering. See this page for more details: http://www.py2exe.org/index.cgi/WorkingWithVariousPackagesAndModules
musicfreak
thanks I will look into this.
JohnWong
Python 'freeze' also does this, and is newer. check out http://wiki.python.org/moin/Freeze
Lee-Man
Freeze only works on Unix-like systems though.
musicfreak
Any modules that you have imported in your code will be compiled into the DLLs that accompany the EXE that has been compiled from you code.
inspectorG4dget
+4  A: 

another alternative you can try is Portable python.

ghostdog74
cool, thanks. i will look into it
JohnWong
+2  A: 

You have the options presented thus far: Portable Python and Py2Exe. Either can be pretty good.

My suggestion: encourage your friends to install Python! As you know, it's free, and simple to install and download. If they want your application bad enough, installing Python will be a no-brainer.

Arrieta
A: 

As musicfreak said, it would be helpful to know what OS your friends are using. One reason being that Mac OS/X and many versions of Linux come with Python pre-installed.

MatrixFrog
*Many* versions of Linux comes with Python pre-installed. They often need it for some installation tools.
EOL
edited to reflect EOL's comment
MatrixFrog
A: 

A less general, but lightweight and simple way of putting many Python files into 1 or 2 files (Python programs) is Fredrik Lundh's squeeze program. When you "squeeze" a bunch of Python programs and modules, you can often produce a single Python program. People still need Python to run it (but it's included in most Unix distributions, including Mac OS X), but you can easily distribute it, as your program and modules are all bunched up in a single file.

EOL