Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 691871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:35:26+00:00 2026-05-14T02:35:26+00:00

I am making a plugin for another program and so I am trying to

  • 0

I am making a plugin for another program and so I am trying to make thing as lightweight as possible.

What i need to do is be able to update the name of a section in the ConfigParser’s config file.

[project name]
author:john doe
email: spam@example.com
year: 2010

I then have text fields where user can edit project’s name, author, email and year.

I don’t think changing [project name] is possible, so I have thought of two solutions:

1 -Have my config file like this:

[0]
projectname: foobar
author:john doe
email: spam@example.com
year: 2010

that way i can change project’s name just like another option. But the problem is, i would need the section # to be auto incremented ([0], [1], etc). And to do this i would have to get every section, sort of, and figure out what the next number should be.

The other option would be to delete the entire section and its value, and re-add it with the updated values which would require a little more work as well, such as passing a variable that holds the old section name through functions, etc, but i wouldn’t mind if it’s faster.

Which of the two is best? or is there another way?
I am willing to go with the fastest/lightweight solution possible, doesn’t matter if it requires more work or not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:35:26+00:00Added an answer on May 14, 2026 at 2:35 am

    ini files are probably best suited for configuring applications, with well-defined inputs and so forth. It sounds like you want a more generic serialization tool; JSON would probably work well for this. Perhaps you want to store a JSON representation of a list (hence your incrementing indices) of dicts with those fields?

    The usage of the json module in the stdlib is pretty simple. For example, to store a couple records you would

    import json
    
    projects = []
    projects.append({'project_name': 'foobar', 
                     'author': 'John Doe', 
                     'email': 'spam@example.com', 
                     'year': '2010'})
    projects.append({'project_name': 'baz', 
                     'author': 'Cat Stevens', 
                     'email': 'cs@example.com', 
                     'year': '2009'})
    
    with open('projects.json', 'w') as f:
        json.dump(projects, f)
    

    Similarly you would recover the serialized data from the file with json.load(f), where you have opened f in read mode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an plugin in ROR and I want to make a migration
I've been trying to make my own plugin system. I have 2 separate projects.
I'm making a plugin system. I have a class extensionmanager that takes the name
I'm making a jQuery plugin that creates a scrollable div. You are able to
I'm making a lightbox plugin called WowBox. Right now, if you want to make
i am making an upload with Ajaxupload plugin and i am using this function
I'm making the script for easy upload many files. I've tried fyneworks plugin ,
Making my first steps with NHibernate, I'm trying to have it creating my Tables
Is there a jQuery plugin for dragging answers from one area to another, and
Does anyone know of a jquery plugin that can make a thumbnail of an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.