Editing values in a xml file with Python

后端 未结 5 1282
执笔经年
执笔经年 2021-01-17 03:08

Hey. I want to have a config.xml file for settings in a Python web app.

I made car.xml manually. It looks like this:


    

        
5条回答
  •  清酒与你
    2021-01-17 03:32

    XML is a rather poor way of storing configuration settings. For one, XML is not exactly human friendly in the context of settings. In the Python universe in particular you are better off using a settings module (as @AaronMcSmooth commented). Unfortunately a lot of projects in the Java world have (mis?)used XML for settings thereby making it a trend. I'd argue that this trend really sucks. Use native settings (module in Python) or something more human friendly like YAML.

提交回复
热议问题