Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Config file update
#1
Hi,

I am using a config file that looks like this:

Output:
[Server] IP: 127.0.0.1 Port: 502 [Action] Test: True I want to update the file using code like this config.cfg.set("Server", "IP", "") config.cfg.set("Server", "Port", "") config.cfg.set("Action", "Test", "False") when I save the file, this is what I have in it: [Server] ip = port = [Action] test = False
The config file gets all messed up with '=' instead of ':' and a boolean instead of string in the last line for example
this is no longer usable in my app
Why is that happening?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Applications config files / Best practices aecordoba 2 2,990 Oct-23-2024, 12:56 PM
Last Post: aecordoba
  How to read csv file update matplotlib column chart regularly SamLiu 2 1,998 Jan-21-2023, 11:33 PM
Last Post: SamLiu
  Is it possible to update a CSS file from Python bigAL_python 4 3,858 Apr-20-2022, 01:38 PM
Last Post: bigAL_python
  value null when update in json file 3lnyn0 6 8,214 Dec-30-2021, 05:52 PM
Last Post: ndc85430
  Updating a config file [solved] ebolisa 8 4,290 Nov-04-2021, 10:20 AM
Last Post: Gribouillis
  |SOLVED] Glob JPGs, read EXIF, update file timestamp? Winfried 5 4,203 Oct-21-2021, 03:29 AM
Last Post: buran
  Is there a library for recursive object creation using config objects johsmi96 0 2,416 May-03-2021, 08:09 PM
Last Post: johsmi96
  help with pytesseract.image_to_string(savedImage, config='--psm 11')iamge to string korenron 0 3,709 Apr-29-2021, 10:08 AM
Last Post: korenron
Question Python + Google Sheet | Best way to update specific cells in a single Update()? Vokofe 1 4,281 Dec-16-2020, 05:26 AM
Last Post: Vokofe
  What is the best way to set application-wide config values? ajorona 1 2,739 May-07-2020, 05:03 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020