Note that there are some explanatory texts on larger screens.

plurals
  1. POPython configuration file generator
    primarykey
    data
    text
    <p>I want to use Python to make a configuration file generator. My roughly idea is feeding input with template files and some XML files with the real settings. Then use the program to generate the real configuration files. </p> <p>Example: </p> <pre><code>[template file] server_IP = %serverip% server_name = %servername% [XML file] &lt;serverinfo&gt; &lt;server ip="x.x.x.x" name="host1" /&gt; &lt;server ip="x.x.x.x" name="host2" /&gt; &lt;/serverinfo&gt; </code></pre> <p>and then get output configuration file like this</p> <pre><code>[server.ini] [server1] server_IP = x.x.x.x server_name = host1 [server2] server_IP = x.x.x.x server_name = host2 </code></pre> <p>I got several questions:</p> <ul> <li><p>Is there any open source configuration generator program? (what could be the keyword), I wonder if there's anything can be added/modified in the design.</p></li> <li><p>Does Python have good XML parser module?</p></li> <li><p>Is it good idea to use XML file to save the original settings? I've been thinking to use Excel since it's more intuitive to maintain, but harder for program to parse. Not sure how people deal with this.</p></li> </ul> <p>Hope the community can give me some suggestions. Thanks a lot!</p> <p>EDIT: In scenario that there are dozens of these output ini files. I am concerning 2 things.</p> <ol> <li><p>there are dozens of ip/hostname and related informations, that may requires to be managed by human, so XML format would be a bit inconvenient. What could be the most convenient structure to manage those information? (Excel would be a handy tool to batch modify and look up info)</p></li> <li><p>In case of need to add some extra line into ini files, I need a efficient way by just modify the template file and add extra info into the source file (may be the Excel file or whatever), then whole bunches of ini files can be generated quickly.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload