100 % portable ?

Roger Binns rogerb at rogerbinns.com
Sun Aug 22 19:26:39 CEST 2004


Vent d'Est - East Wind wrote:
> i want to know how i can be sure at 100 % that my programme is portable
> (i dont want code each times i use other system )

You will have to run your program on all platforms.  The Python
library documentation pages tell you which platform the modules
are on.  The vast majority are on all.

Note that for some things you would want different code.  For
example the default location to save files may be My Documents
on Windows and $HOME on Linux and Mac.  Similarly you would
want to save configuration settings in the registry on Windows
and dot files on Linux and Mac.

> i suppose for GUI is same

My preferred toolkit is the wxPython wrapper around wxWidgets.
Wherever possible it uses native widgets.  It also has functionality
often lacked by other toolkits such as printing, keyboard,
configuration (backend to registry, files etc).

Just to give you some idea, in my 30,000 line program there are
5 tests to see what platform it is running on, specifically to
ensure appropriate defaults etc for the platform.

For the gui, there are two programs you can try that use wxPython.

    http://dotamatic.sf.net
    http://bitpim.org

Both are open source so you can see for yourself.  Both use the
clipboard, do printing, have online help, are distributed so
that the user doesn't need Python on their machine already etc.

Roger 





More information about the Python-list mailing list