Can python see which windows i use e.x. windows 7 windows xp windows vista and if windows vista print you use windows vista, or execute other command
platform lives in sys module. import sys sys.platform
Aaron
2010-10-14 13:27:23
@Aaron: `sys` has a `platform` attribute, but there is also a separate `platform` module.
Ignacio Vazquez-Abrams
2010-10-14 13:28:35
@Ignacio: oh nice, didn't know that
Aaron
2010-10-14 13:30:16
nice but what when we want to chose between versions of windows??
geocheats2
2010-10-14 13:35:18
Have you had a chance to try the various functions in the module yet?
Ignacio Vazquez-Abrams
2010-10-14 13:38:40
i have tryed to search platform.system_alias but how do i know what the alias of every system are??
geocheats2
2010-10-14 13:57:52
+1
A:
import platform
platform.system() # => 'Windows'
platform.release() # => 'Vista'
platform.version() # => '6.1.7600'
I believe if platform.version() returns a value of 6.1.7000 or higher, you're on a Windows 7 machine, otherwise it is Vista.
Chris G.
2010-10-15 05:40:29