Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed Python interpreter in a Python application

I'm looking for a way to ship the Python interpreter with my application (also written in Python), so that it doesn't need to have Python installed on the machine.

I searched Google and found a bunch of results about how to embed the Python interpreter in applications written in various languages, but nothing for applications written in Python itself... I don't need to "hide" my code or make a binary like cx_freeze does, I just don't want my users to have to install Python to use my app, that's all.

like image 470
mdeous Avatar asked Mar 14 '10 04:03

mdeous


People also ask

What is embed in Python?

Embedding provides your application with the ability to implement some of the functionality of your application in Python rather than C or C++. This can be used for many purposes; one example would be to allow users to tailor the application to their needs by writing some scripts in Python.


1 Answers

For distribution on Windows machines, look into py2exe

py2exe is a Python Distutils extension which converts Python scripts 
into executable Windows programs, able to run without requiring a 
Python installation

For the MacIntosh, there is py2app (but I'm not familiar with it)

And for both Windows and Linux, there's bbfreeze or also pyinstaller

like image 103
mjv Avatar answered Oct 05 '22 23:10

mjv