import sys if 'win' in sys.platform():
or you can try importing a platform dependent library
try: import windows_only as generic except ImportException: try: import unix_only as generic except ImportException: import stdlib.module as generic print generic.common_function()
and then always reliable
>>> import os >>> os.name nt
source share