开发者

get environment ( windows or unix) using jython

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'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜