What is the best way to distribute a python program extended with custom c modules?

I've been learning python for several years, but now I'm slowly learning how to work with c. Using the python documentation I found out how to distribute my python programs with some c as it seemed like a logical way to start playing with it. Now my question is how to distribute such a program.

I suppose the crux of my question is how to compile things. I can do this easily on my machine (gentoo), but a binary distribution like Ubuntu doesn't have a compiler by default. Also, I have several friends who are Mac users. My instinct says that I can't just compile my machine and then run it on another. Does anyone know what I can do, or some online resources to learn about things like this?


source to share

2 answers

Please read about distutils. In particular, the section Extension Modules .

Making assumptions about compilers is bad policy; your instinct may not have all the facts. You can do market research - ask what they can use in relation to plug-in distribution.

It's relatively easy to create the correct distutils setup.py

and see who can run it and who can't.

Built-in binaries are fairly common. Perhaps you can register some users to help build binary distributions - with OS installers - for some reasons.



S. Lott is right. You should first look at distutils. After you know what you need from distutils take a look at setuptools . Setuptools is built on top of distutils and makes installation easy for your users. Have you ever used easy_install or Python Eggs? What's next.



All Articles