Python host information
Alberto Griggio
albgrig at tiscalinet.it
Thu Mar 13 13:48:41 EST 2003
Hello,
> When I start a Python shell, I get:
>
> Python 2.2.2 (#1, Feb 3 2003, 14:10:37) [GCC 3.2 20020927
> (prerelease)] on cygwin
>
> Is there a (portable) way to get all these informations from within
> a Python program?
[alb at gandalf alb]$ python
Python 2.2.2 (#4, Oct 15 2002, 18:07:38)
[GCC 3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.platform
'linux2'
>>> sys.version
'2.2.2 (#4, Oct 15 2002, 18:07:38) \n[GCC 3.1]'
>>> sys.version_info
(2, 2, 2, 'final', 0)
>>>
HTH,
Alberto
More information about the Python-list
mailing list