[IronPython] What is a good way to determine OS platform with IronPython?

Doug Blank doug.blank at gmail.com
Tue Jan 11 00:14:28 CET 2011


> On Mon, Jan 10, 2011 at 3:37 PM, Douglas Blank <dblank at brynmawr.edu>
> wrote:
>> Now that IronPython runs on other operating systems, what is the
>> recommended way to determine the os when running IP?
>
> `os.name` is probably what you want. There was some discussion on
> python-dev about a module (or extension to sys?) that would have a lot
> more information, but I can't remember what it was going to be called.

Thanks. FYI, under Mono:

IP on mac: os.name == 'posix'
IP on linux: os.name == 'posix'
IP on windows 7: os.name == 'nt'

I'll have to figure out a different way to distinguish between mac and
linux. Even sys.getwindowsversion() gives a platform of 4 for Mac and
Linux under Mono.

-Doug

> - Jeff
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>



More information about the Ironpython-users mailing list