How can I get a Python compiler string programmatically?

The Python interpreter input message contains a string describing the compiler.

For example, on my machine, the login message says:

Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32 

Where [MSC v.1500 64 bit (AMD64)] is the compiler line.

How can I get this line programmatically?

+5
source share
1 answer

You can get such information from the platform module, for example:

 import platform platform.python_compiler() 

gives me:

 'GCC 4.9.2' 
+5
source

Source: https://habr.com/ru/post/1244745/


All Articles