Jump to content
  • Advertisement
Sign in to follow this  
SpacedOut

If I embed Python into C++, will any comp I run the program on need python installed?

This topic is 4428 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Guest Anonymous Poster
Quote:
Original post by SpacedOut
I've seen plenty on code to embed Python, but not much on how to link libraries, and build


Depends on how exactly you do embed the python interpreter: usually, you will simply want to link to the libraries dynamically, this would require python (the libs that is) to be installed on any system running your app, as well.
Alternatively, you can provide your binary linked statically to the python interpreter, that way the whole thing would be self-contained and would not require any separate python libs.



Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster

Depends on how exactly you do embed the python interpreter: usually, you will simply want to link to the libraries dynamically, this would require python (the libs that is) to be installed on any system running your app, as well.
Alternatively, you can provide your binary linked statically to the python interpreter, that way the whole thing would be self-contained and would not require any separate python libs.

This is quite inexact.
The Python interpreter is a rather small shared library (e.g. python24.dll), usually installed to global library directories (e.g. c:\windows\system32); the executables and scripts installed to the Python directory are irrelevant for embedding. applications link to this dynamic library and if it is redistributed with the application (in its private directory) existing Python installations won't be involved.
Python libraries can be bundled with the application in a similar way, excluding unneeded ones and possibly replacing them with customized versions.

Share this post


Link to post
Share on other sites
so if I linked python24.dll with my C++ program and compiled it, then distributed the program with the library in the proper directory, that would be all I need to do?

Share this post


Link to post
Share on other sites
Quote:
Original post by SpacedOut
so if I linked python24.dll with my C++ program and compiled it, then distributed the program with the library in the proper directory, that would be all I need to do?


Yes.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
That's true as long as you don't use any script from the Python distribution.

It means you will have to distribute those files. You can choose to install the whole lib ( Lib + libs directories ), or only those you are interested in.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!