[Python Wpg] Question about portability

Sydney Weidman syd at plug.ca
Mon Oct 16 21:57:42 EDT 2006


I do most of my python development on Linux, but I've got some things
which are now being distributed publicly and Windows users are asking me
to make things more portable. I have a bit of software that uses an
ini-style configuration file. In Linux, it's easy to figure out where to
put it: /etc/zopeutils.ini. In Windows I'm not so sure anymore. In my
code, I could guess where the standard place for config files is on
Windows or take a command line config file option, but it would be bad
to have the arguments be optional on *nix/OSX and be mandatory on
Windows. It would make more sense if python had something in the os
module that would tell me where the right place is. Does anyone know the
canonical way of finding where Windows puts a config file? Do I have to
read registry keys? Does it live in $WINDIR/appname.ini, or am I stuck
int he Win3.1 era?

Thanks for any advice.


-- 
Sydney Weidman <syd at plug.ca>
Prairie Linux User Group



More information about the Winnipeg mailing list