Adapting code to multiple platforms
Paul Watson
pwatson at redlinepy.com
Sun Mar 13 16:21:58 EST 2005
"Peter Hansen" <peter at engcorp.com> wrote in message
news:EdWdnaVJQLjEdK_fRVn-gw at powergate.ca...
> Simon John wrote:
>> If you're using a GUI, then that may help you decode the platform too -
>> for example wxPython has wx.Platform, there's also platform.platform()
>> , sys.platform and os.name
>>
>> You could try import win32api and checking for an exception ;-)
>
> (Winky noted) Just in case anyone thinks that last is a
> useful idea, keep in mind that win32api is not installed
> (with the standard distribution) but must be installed
> with a separate download of the pywin32 package by Mark
> Hammond.
>
> -Peter
How about try: import msvcrt
More information about the Python-list
mailing list