Python module database configuration? -


I have Pyro module in which some objects are included, some of which uses MySQL connections to continue some data . What is the best way to allow easy configuration of MySQL connection information, without the user having to go to the installed module location and edit the files?

Allow user to write configuration information for a program in a file format, which Know how to parse - In this way, the user does not "go to the installed module location", but edit the configuration file at more convenient locations.

This is traditional and helpful for the program to try to read both a "per-user" configuration file (in the user's home directory or in its subdirectory), and the "per-location" configuration file Which the system administrator can use to provide users with some default; Therefore, the method of the configuration parser object accepts a list of filenames and tries to parse each of them in the sequence (see I have a simple example in document docs).


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -