用os和platform>>> import os>>> os.name'nt'>>> import platform>>> system = platform.system()>>>print system'Windows'>>> platform.release()'Vista'Windows和Linux系统显示都正常MAC OSX的platform.system()是"Darwin"