1

OK, I've written a stupid simple little python program called Coloriffic that lets you adjust values of red, green, and blue and display the resulting color. I used Pygame to accomplish this.

I then looked around for how to turn that into a simple program I could give to someone else without them needing to have Python or Pygame installed. After reading of a few options (and several pieces of advice on this very site), it seemed that most people recommended cx_freeze so I downloaded the WHL and installed it. I built a setup.py script, which wasn't hard as Coloriffic has no images or other external files, and is a very simple program.

When I ran the setup.py, it worked! It created a Coloroffic.exe that ran just fine. The problem is, it also created a directory with a hundred other support files. I tried creating an MSI installer, which did give me a single executable, but one that when run simply drops the same hundred+ files in another directory.

Is there a way to take my utterly simple Coloriffic.py program and convert it into a single Windows exe file that has everything it needs INSIDE the exe and that doesn't need to be installed? I'm trying to figure out if in Python I can take my .py programs and compile them into single executables without creating a directory of support files?

If so, how do I do that?

Thanks.

EDIT: Not looking to make it closed source, just looking to gather up everything in a single file. Also, I read that "py2exe will make the exe file you want but you need to have the same version of MSVCR90.dll on the machine you're going to use your new exe" - that could be a problem, unless all Windows machines from 7 on have this file all in the same version? This is the very reason for me asking this is the first place, to create a fully independent EXE file. I also see some people recommending cx_freeze, but either they don't understand that it doesn't create a single file, or I don't understand how to make it. Is there a way to make cx_freeze create a single standalone exe?

I guess I can hope that the MSVCR90.dll dependency has been done away with and try py2exe - but I would love some advice before I go down that road if it's the wrong one.

Thanks for the suggestions and the links to other answered questions, but I still don't see a straight answer to this one?

EDIT2: One more note, when I use cx_freeze to create the executable, and then I run Coloriffic.exe, first it creates what looks like a black Dos-box window, then a second window pops up with my program. I would also like for the executable to launch just ONE window, my program, without a Dos type window coming up first and remaining up behind the program window. Thanks.

Sindyr
  • 1,277
  • 1
  • 11
  • 16
  • 1
    possible duplicate of [How to make a Python script standalone executable to run without ANY dependency?](http://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency) – Mel Aug 18 '15 at 13:41
  • or this one: [Process to convert simple Python script into Windows executable](http://stackoverflow.com/questions/2136837/process-to-convert-simple-python-script-into-windows-executable) – Mel Aug 18 '15 at 13:42
  • Thanks, I read through those and amended my question above in the light of the information there. – Sindyr Aug 18 '15 at 14:07
  • Possible duplicate of [py2exe - generate single executable file](http://stackoverflow.com/questions/112698/py2exe-generate-single-executable-file) – Cees Timmerman May 18 '17 at 14:16

1 Answers1

0

Try Py2exe, this is a pretty easy and fast approach: Py2exe Tutorial

exe has not to be installed, but it also creates support files in the same directory

Maximilian
  • 1,325
  • 2
  • 14
  • 35
  • I read that Py2exe has a MSVCR90.dll dependency, and depending on what version the windows computer has, it may well not work? – Sindyr Aug 18 '15 at 13:54