存储python程序设置的官方方式是什么? [英] What's the official way of storing settings for python programs?

查看:68
本文介绍了存储python程序设置的官方方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Django使用真实的Python文件进行设置,Trac使用.ini文件,其他一些软件使用XML文件来保存此信息.

Django uses real Python files for settings, Trac uses a .ini file, and some other pieces of software uses XML files to hold this information.

Guido和/或Python社区是否更偏爱其中一种方法?

Are one of these approaches blessed by Guido and/or the Python community more than another?

推荐答案

取决于主要的目标受众.

Depends on the predominant intended audience.

如果仍然是程序员更改文件,则只需使用python文件(如settings.py)即可.

If it is programmers who change the file anyway, just use python files like settings.py

如果是最终用户,请考虑使用ini文件.

If it is end users then, think about ini files.

这篇关于存储python程序设置的官方方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆