You can compile Python in various ways. I'd like to find out with which options my Python was compiled.
Concrete use-case: was my Python compiled with readline? I know I can see this by doing "import readline", but I'd like to see a list of compilation setting for my Python binary.
Edit: I mean the Python executable and not source code written by myself.
There is a module to see the system config
It offers an interface to get individual variables as well.
Edit:
before python2.7, you have to use
And another way to do it... Python supplies scripts per installed version...
The answers from one of my systems are:
So if you need setting values for bash scripts and such, these are available with this command line utility.
To build on mirk's answer, to find the configure flags that were actually used during the build, the value you're looking for is
CONFIG_ARGS
.For example, this is the output for an Ubuntu-compiled Python:
To get the list of options that PyPy was compiled with, run
Here is a command that i use to compare different python configurations. It includes getting the value of the outputs: