Wednesday 15 June 2016

pyqgis - How can I discover the Python version in QGIS?


Where can I discover the Python version installed in QGIS 2.18.1?


I would like to buy a book to introduce me at Python interface. I´ve found one that addresses the version 3.3 of Python.



Answer



Alongside sys.version_info, as mentioned above, you can use


import sys

sys.version

sys.version_info will give this kind of output (this comes from my copy of QGIS 2.18.1):


>>> import sys

>>> sys.version_info

sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0)

sys.version will give the version number, alongside the compiler used:



>>> import sys

>>> sys.version

'2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]'

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...