preferences file

songbird songbird at anthive.com
Mon Jan 28 07:02:47 EST 2019


DL Neil wrote:
> On 25/01/19 4:22 PM, Bill Campbell wrote:
>> On Thu, Jan 24, 2019, Dave wrote:
>>> I'm doing a small application and want to add user preferences.  Did some
>>> googling to see if there are standard Python ways/tools, but it seems not so
>>> much.  My specific questions are:
>>>
>>> 1. Best practices for a user preference file/system?
>> 
>> Generally I put them in the user's $HOME or $HOME/etc directory
>> with appropriate permissions unless working in a virtual
>> environement.
>
> Good idea.
>
> What about running a multi-tenant application (for multiple users who 
> are not also system-users) - cf them logging-on to run their own. It is 
> appropriate, possibly even "required" to keep Fred's config file, 
> reports, graphs, logs, etc; separate from Barney's. Ideally they will 
> not be sub-dirs of the application/package.

  if it is per user defined then $HOME/.config/<app-name>, 
$HOME/.local/share/<app-name> and any temporary data can go 
in $HOME/.cache/<app-name> will do it for posix on Windows 
there is the per user app stuff which i haven't sorted out
yet.

  $HOME changes per user login name change.


  songbird



More information about the Python-list mailing list