Python: What OS am I running on? *

Question

What do I need to look at to see if I'm on Windows, Unix, etc?

Answer

>>> import os
>>> print os.name
posix
>>> import platform
>>> platform.system()
'Linux'
>>> platform.release()
'2.6.22-15-generic'

See: platform — Access to underlying platform’s identifying data

< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/1854/" >Python: What OS am I running on?< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment