Python 3: Print Version String from Script

By Xah Lee. Date:

Print version number from within the script.

# python 3

import sys
print(sys.version)

# 3.2.3 (default, Oct 19 2012, 20:13:42) [GCC 4.6.3]

If you have a question, put $5 at patreon and message me.

Python 3

Lang Detail

  1. Print Version String
  2. Quoting String
  3. String Operations
  4. Format String
  5. Operators
  6. Object, ID, Type

Misc

  1. Traverse Directory
  2. Sort List, Matrix, Object
  3. Python 3: Map with Side Effect Doesn't Work If Result is Not Used
  4. Python 3 Closure
  5. Python 2 and 3 Difference