Saving parameters between Python applications?

bryanjugglercryptographer at yahoo.com bryanjugglercryptographer at yahoo.com
Mon Sep 17 16:29:27 EDT 2007


On Sep 17, 6:39 am, Laurent Pointal
> May use simple file in known place:
> $HOME/.myprefs
> $HOME/.conf/myprefs
>
> Or host specific configuration API:
> WindowsRegistry HKEY_CURRENT_USER\Software\MySociety\MyApp\myprefs
>
> See os.getenv, and _winreg Windows specific module.
> See also standard ConfigParser module


Also, os.path offers expanduser(). The following is reasonably
portable:

    import os

    user_home_dir = os.path.expanduser("~")


--
--Bryan




More information about the Python-list mailing list