how to find out if the environment is windows or unix . I want to execute such similar code as s开发者_StackOverflow中文版hown below. Please suggest
import os
if (os.getenv("windows"):
os.system(cmd/c ...)
if (os.getenv("unix")
os.system(sh shellscript.sh)
Thanks for all your help.
Use System.getProperty to get the os.name property.
>>> import java.lang.System
>>> java.lang.System.getProperty('os.name')
u'Mac OS X'
精彩评论