Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I very recently wrote a program for a friend where it simplifies some important daily calculations for him/her. Now, the problem I am having is that I want to compile the code into an executable program so that he/she can comfortably run it on their machine, perhaps with a simple graphical interface or whatnot.

I have tried using cx_Freeze with Python 3.3.0 64 bit but to no avail (the program simply refuses to start on their machine; I even tried generating an executable via 32-bit Python, but also to no avail). What I then thought was that I could perhaps generate an executable program via PyGame? But the fact of the matter is that I have never used any Python-related program except the IDLE, so I am not sure what to do and look for.

Another option would perhaps be to convert the Python 3.3.0 code to Python 2.x, but the problem is that I am not familiar with Python 2.x and neither is there any automated converter available (as far as I know). I was wondering whether anyone of you could direct me to any good sources/links, since those I have been ferociously Googling are rather inconcrete.

share|improve this question
    
Try this : PyInstaller –  Thanakron Tandavas Mar 24 '13 at 11:27
1  
For just one machine, why don't you simply install Python 3.3 on it with the dependencies? Name the main script __main__.py, zip all the files, and change the extension to .pyw. –  eryksun Mar 24 '13 at 12:03
    
PyInstaller is not compatible with Python 3.x, but thank you anyway. @eryksun: I suppose I could do that. The program is just one .py-file, how exactly do I go about with the zipping and renaming? –  kapython Mar 24 '13 at 12:40
    
@eryksun: Ok, but I need to obtain the dependencies and include them in the files I am going to send to my friend. Hm, what are you referring to when you write "pylauncher"? –  kapython Mar 24 '13 at 15:05
    
Note that if you use cx_Freeze, you need to copy the files it saves alongside the executable - usually some DLLs and possibly a zip file. The .exe won't work without those. –  Thomas K Mar 24 '13 at 18:54

3 Answers 3

You could just use py2exe. It is compatible with python 3. I have seen tutorials for it on youtube.

share|improve this answer
    
py2exe don't appear to support Python 3 yet. There's a py3exe effort in the repository, but it doesn't look like it's ready to use yet, and it hasn't seen any commits in a few months. –  Thomas K Oct 29 '13 at 17:07

You could try embedding it in a C program, and compiling that for your executable. A decent tutorial is in the python docs at http://docs.python.org/2/extending/embedding.html

share|improve this answer

PyInstaller "is a program that converts (packages) Python programs into stand-alone executables, under Windows, Linux, Mac OS X, Solaris and AIX" and gives you one standalone executable file.

Even as a noob Python user I have succeeded to pack my app using PyInstaller (relatively) easily.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.