I know python is an interpreted language but is there a way to compile your code? What if you write a program in python 3 and the user has python 2.x, or worse yet, doesn't have python at all. How can you create an executable via compiling or any other means so the you don't have to worry about what your users may or may not have. I know there is a way to do this in Windows because I seen it in one of my python books.

Recommended Answers

All 4 Replies

Try PyInstaller perhaps. Notice that most linux distributions ship with python 2 or 3 installed or both, or the other one can be installed with a few keystrokes, so I don't think a stand alone executable is very useful.

cx_Freeze works Python 2 and 3.
gui2exe for all installers into a GUI interface.

As mention by Gribouillis on Linux it's ofen no problem to just give away .py files.

In my project wx_nrk for downloading all on norwegian TV.
I choiced to compiled to exe for Windows user and for Linux user i just made read_me file with step how to use it.
I could have make a compiled version for Linux but it's more easy for Linux user because Python is pre_installed.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.