3

I need to be able to send someone a python program but they dont have python, is there a way to compile the python program and open it as a normal computer program.

Any help would be appreciated

James Turner
  • 153
  • 2
  • 3
  • 9
  • I'm assuming that you are talking about Windows machines as it's pretty standard to have some python implementation on pretty much any unix system... You should add this information to the body of your post as it is most certainly relevant to the types of answers you will receive. – Lix Dec 18 '14 at 14:11
  • See http://stackoverflow.com/questions/138521/is-it-feasible-to-compile-python-to-machine-code – André Laszlo Dec 18 '14 at 14:12

1 Answers1

2

Yes, you can use cxfreeze. Documents are here.

Gist of them is that you need to create a distutils setup file to specify which modules are required and any other resources that should be included. You can then run python setup.py build to create your build application.

As mentioned in the docs, you can then use something like inno setup to make an .exe file from the output of cxfreeze.

It's been a while since I've used it but I can look back over how I set it up if you need any more help getting it running.

Holloway
  • 4,301
  • 1
  • 25
  • 30