GithubHelp home page GithubHelp logo

oz4p4x3 / python-configparser-template Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1 KB

Python project which provides a skeleton you can add to your project to take advantage of the Python ConfigParser.

Python 100.00%
python python-config python-configparser python-configuration python-configuration-reader python-template python-skeleton

python-configparser-template's Introduction

Python ConfigParser Template

This python project provides a skeleton you can add to your project to take advantage of the Python ConfigParser.

Included

  • config_controller.py: A module for reading and writing to the ini files.
  • examples.py: Examples of how to use/manipulate your configuration file.
  • configuration/app.ini: An example ini file you can edit to meet your requirements or use as a template for your own configuration files.

How To Use

  1. Clone this repository.
  2. Copy the contents into your project.
  3. Use the app.ini file as a template to create your own configuration files.
  4. Import the config_controller module into your application when you need to interact with your configuration files.
  5. Look below for a basic example of how to use this skeleton project or example.py for more detailed examples.

Usage Example

import config_controller

config_file = "app.ini"
app_config = config_controller.init_config(config_file)

# get float value
version_number = app_config.getfloat("about", "version")

# update the log level
app_config.set("log", "log_level", "INFO")

# update the configuration file with the new value
config_controller.save(config_file,app_config)

python-configparser-template's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.