Re: Adapting code to multiple platforms

2005-03-13 Thread Peter Hansen
Paul Watson wrote: "Peter Hansen" <[EMAIL PROTECTED]> wrote: Simon John wrote: 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

Re: Adapting code to multiple platforms

2005-03-13 Thread Paul Watson
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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 impo

Re: Adapting code to multiple platforms

2005-03-12 Thread Patrick Useldinger
Jeffrey Barish wrote: I have a small program that I would like to run on multiple platforms (at least linux and windows). My program calls helper programs that are different depending on the platform. I think I figured out a way to structure my program, but I'm wondering whether my solution is go

Re: Adapting code to multiple platforms

2005-03-12 Thread Peter Hansen
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

Re: Adapting code to multiple platforms

2005-03-11 Thread Simon John
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 ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Adapting code to multiple platforms

2005-03-11 Thread Jeremy Bowers
On Fri, 11 Mar 2005 17:27:06 -0700, Jeffrey Barish wrote: > Most of my program lives in a class. My plan is to have a superclass > that performs the generic functions and subclasses to define methods > specific to each platform > I'm just getting up to speed on Python and OOP, so I'm wondering

Re: Adapting code to multiple platforms

2005-03-11 Thread Michael Spencer
Jeffrey Barish wrote: class super: '''All the generic stuff goes here''' Better not to call the class super: it's a built-in type class linux_subclass(super): def func(self): '''linux-specific function defined here''' class windows_subclass(super): def func(self): '''win

Adapting code to multiple platforms

2005-03-11 Thread Jeffrey Barish
I have a small program that I would like to run on multiple platforms (at least linux and windows). My program calls helper programs that are different depending on the platform. I think I figured out a way to structure my program, but I'm wondering whether my solution is good Python programming