4

Although I'm using a Mac with MacPorts installed, I suppose this question can be applied to other platforms.

When I list all those executable files in $PATH with the "python" prefix, I get a bunch of results:

//64-bit Mac Mini @work/
$ IFS=:

//64-bit Mac Mini @work/
$ find $PATH -name python\*
/opt/local/bin/python3
/opt/local/bin/python3m-config
/opt/local/bin/python3.7-config
/opt/local/bin/python2.7-config
/opt/local/bin/python3.7m
/opt/local/bin/pythonw2.7
/opt/local/bin/python3.7m-config
/opt/local/bin/python3.7
/opt/local/bin/python3-config
/opt/local/bin/python2.7
/opt/local/bin/python3m
/usr/bin/python
/usr/bin/pythonw
/usr/bin/python2.7-config
/usr/bin/pythonw2.7
/usr/bin/python-config
/usr/bin/python2.7

I know what python[23]* are, but what does python3.7m, python3m, pythonw, pythonw2.7 and those python*-config do?

Update

Thanks for the comment pointing out the possible duplicate. However that doesn't fully solve my question, as it doesn't mention the "w" flag on python2.7 interpreter, nor does it mention what the function of those *-config programs are.

DannyNiu
  • 1,313
  • 8
  • 27
  • 1
    Possible duplicate of [Difference between python3 and python3m executables](https://stackoverflow.com/questions/16675865/difference-between-python3-and-python3m-executables) – Bernhard Jul 12 '19 at 05:25

1 Answers1

0

The existing questions' answers solved most part of my confusion.

The suffix letters indicates the "ABI version" for the specific build of the CPython implementation, which one can take a look at this GitHub commit

As for the 'w' flag in the 2.x version, it's all explained in the man page:

pythonw -- run python script allowing GUI

...

Actually, since Python 2.5, the normal python also allows GUI access, so python and pythonw are now interchangeable.

One can also find discussion for it on Bytes.com

The python*-config programs are used for building programs that uses python, it's a bit like the "pkg-config" application, specialized for python.

DannyNiu
  • 1,313
  • 8
  • 27