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
  How to read csv file update matplotlib column chart regularly SamLiu 2 1,072 Jan-21-2023, 11:33 PM
Last Post: SamLiu
  Is it possible to update a CSS file from Python bigAL_python 4 2,297 Apr-20-2022, 01:38 PM
Last Post: bigAL_python
  value null when update in json file 3lnyn0 6 3,287 Dec-30-2021, 05:52 PM
Last Post: ndc85430
  Updating a config file [solved] ebolisa 8 2,609 Nov-04-2021, 10:20 AM
Last Post: Gribouillis
  |SOLVED] Glob JPGs, read EXIF, update file timestamp? Winfried 5 2,499 Oct-21-2021, 03:29 AM
Last Post: buran
  Is there a library for recursive object creation using config objects johsmi96 0 1,856 May-03-2021, 08:09 PM
Last Post: johsmi96
  help with pytesseract.image_to_string(savedImage, config='--psm 11')iamge to string korenron 0 2,708 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 2,696 Dec-16-2020, 05:26 AM
Last Post: Vokofe
  What is the best way to set application-wide config values? ajorona 1 1,918 May-07-2020, 05:03 PM
Last Post: buran
  Config file entry as list versus string? taziuk 2 1,832 Apr-25-2020, 12:01 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

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