Wednesday, February 11, 2009

Get the version of gcc with python.

I needed to get the version of gcc in a python script (Ubuntu Linux). And here it is:
commands.getoutput("gcc -v").split(' ')[-4:-3][0]
Python is fun...