Python – Version Number

Background

Now that we have Python installed, let us write a little “helloWorld” application.

Code

Script


import sys;
import platform;

outputFormatVersionInfo = "Python Version Number ( %s) is %s";

versionNumberSys = sys.version_info;

versionNumberPlatform = platform.python_version();

print "";
print "";

print(outputFormatVersionInfo % ('sys.version_info', versionNumberSys));

print "";
print "";

print(outputFormatVersionInfo % ('platform.python_version', versionNumberPlatform));
 

Invoke


python script/python/version/version.py 

Output

Image

python.versionNumber.script.01.20200520.0758AM

Text


Python Version Number ( sys.version_info) is sys.version_info(major=2, minor=7, micro=16, releaselevel='final', serial=0)


Python Version Number ( platform.python_version) is 2.7.16
>
 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s