Saturday Snippet: Finding the Python and PyWin version


Courtesy of Eric Thivierge:

import sys
import os
import distutils
import distutils.sysconfig
site_packages = distutils.sysconfig.get_python_lib(plat_specific=1)
build_no = open(os.path.join(site_packages, "pywin32.version.txt")).read().strip()
print "Python version:   " + sys.version
print "PyWin32 version:  " + build_no

See also Supported versions of Python and PyWin

1 thought on “Saturday Snippet: Finding the Python and PyWin version

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s