Questions tagged [configparser]
ConfigParser is a Python module for reading and writing configuration files that have a structure similar to those of INI files in Microsoft Windows.
configparser
684
questions
1
vote
0
answers
31
views
Case insensitive section in ConfigParser
I am trying to set up ConfigParser so that it would be case insensitive to section input value when using e.g. parser.items(section, raw, vars) or parser.get(section, option, **kwargs). Let's say my ...
1
vote
0
answers
32
views
Looping a configparser-object and convert to class objects
i have this class-instance:
class classValve:
def __init__(self, gpio, name, mode):
self.gpio = gpio
self.name = name
self.mode = mode
self.valve_open = GPIO.LOW
...
0
votes
2
answers
47
views
Why is tkinter.OptionMenu['menu'] = None?
When I close my acquisition_para(), and try to reopen it (like every other parameter) it gives me this error:
menu.delete(0, 'end')
AttributeError: 'NoneType' object has no attribute 'delete'
I don't ...
0
votes
0
answers
48
views
How can I write to an .INI config file without loading the entire file first
I am trying to write to a .ini file without having to load the entire file first. It seems like a waste of CPU to load a INI file just to make a small change and write the entire file out again. ...
0
votes
1
answer
51
views
How to get kivy to set its defaults in the Config at runtime?
How can I tell Kivy to update a given Config with its default values at runtime?
I have a "reset settings to defaults" button in my app that deletes all of the entries in my Kivy Config, ...
0
votes
1
answer
31
views
What's the proper way to retrieve and use the contents of configparser keys and values
I'm generating a config file from code on the assumption that I'll be able to load the config file and use it.
The expected result is to be able to assign the values in the config file to a variable.
...
0
votes
0
answers
71
views
Python: configparser.InterpolationSyntaxError: '$' must be followed by '$' or '{', found: '$!'
I have psw: Test123$! string in my configs.ini and tryin to read it with the following code will result in configparser.InterpolationSyntaxError: '$' must be followed by '$' or '{', found: '$!' error:
...
0
votes
0
answers
24
views
Error configparse some unknown option in read_database_uri
I try to run sql query in python, but got this error today:
Called result::unwrap() on Err Value: Error {kind:configParse, cause:some(unknown option(“part of my uri link)
But I did run this same code ...
0
votes
0
answers
43
views
ConfigParser can't read file when using Relative Imports in Local Package
I am getting this error --
Traceback (most recent call last):
File "F:\Coding\user.py", line 2, in <module>
from db_handler.handler import check
File "F:\Coding\db_handler\...
1
vote
0
answers
31
views
Using ConfigParser in Python with INI name in a variable
I have two 'conf' files with content in '[section] name=value' format.
The first conf file has a value that contains the name of a second conf file.
I can use ConfigParser.read() to read the first ...
0
votes
1
answer
117
views
Using same config file in multiple scripts/modules
Hello I develop a web app with Flask, I use a config file (config.ini) with the ConfigParser library.
I want to factorize the code, because I need to use the same config.ini file in multiples scripts ...
0
votes
0
answers
82
views
ConfigParser Issue Reading Leading Tabs vs Spaces
I'm having an issue where I have a config file (which can be edited by non-programmers ... and hence they don't understand the consequences of using a tab vs spaces). The issue is that sometimes they ...
0
votes
0
answers
22
views
loading a piece of python code as a variable in config parser
I'm using a config parser to load variables:
config = configparser.ConfigParser()
config.optionxform = str
config.read(file_parameters)
and one of them is a piece of source code to be executed by ...
1
vote
1
answer
74
views
The code alone works, but when i import webbrowser, even if it doesn't have nothing to do with it [duplicate]
Obviously it's part of a big application but that's the minimal reproducible example
The code should save something in config.ini but I can't manage to make it work when it goes into the whole app:
...
0
votes
0
answers
156
views
configparser Not Recognizing Sections in config.ini
I'm trying to use the configparser module in Python to read from a config.ini file. Despite having a [example_section] in my config.ini file, when I run my script, it keeps printing that the section ...