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

  • Home
  • SEARCH
  • 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 3310790
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:48:02+00:00 2026-05-17T21:48:02+00:00

According to the documentation: The configuration file consists of sections, led by a [section]

  • 0

According to the documentation:

The configuration file consists of
sections, led by a [section] header
and followed by name: value entries,
with continuations in the style of RFC
822 (see section 3.1.1, “LONG HEADER
FIELDS”); name=value is also accepted.
Python Docs

However, writing a config file always use the equal sign (=). Is there any option to use the colon sign (:)?

Thanks in advance.

H

  • 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-17T21:48:03+00:00Added an answer on May 17, 2026 at 9:48 pm

    If you look at the code defining the RawConfigParser.write method inside ConfigParser.py you’ll see that the equal signs are hard-coded. So to change the behavior you could subclass the ConfigParser you wish to use:

    import ConfigParser
    class MyConfigParser(ConfigParser.ConfigParser):
        def write(self, fp):
            """Write an .ini-format representation of the configuration state."""
            if self._defaults:
                fp.write("[%s]\n" % DEFAULTSECT)
                for (key, value) in self._defaults.items():
                    fp.write("%s : %s\n" % (key, str(value).replace('\n', '\n\t')))
                fp.write("\n")
            for section in self._sections:
                fp.write("[%s]\n" % section)
                for (key, value) in self._sections[section].items():
                    if key != "__name__":
                        fp.write("%s : %s\n" %
                                 (key, str(value).replace('\n', '\n\t')))
                fp.write("\n")
    
    filename='/tmp/testconfig'    
    with open(filename,'w') as f:
        parser=MyConfigParser()
        parser.add_section('test')
        parser.set('test','option','Spam spam spam!')
        parser.set('test','more options',"Really? I can't believe it's not butter!")
        parser.write(f)
    

    yields:

    [test]
    more options : Really? I can't believe it's not butter!
    option : Spam spam spam!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the document, http://www.playframework.org/documentation/1.2.3/configuration#java if I define java.source in conf/application.conf then I should
According to LogEntries documentation Account key should be filled in Web.config file. At the
according documentation: On success, the function returns the converted integral number as a long
According to Hibernate documentation : After observing that arrays cannot be lazy , you
According to Apple documentation and other documentation I have read about on disk encryption
According to the documentation for -[UIView setNeedsLayout] : Because this method does not force
According to the documentation of java.util.Pattern , the POSIX character class \p{Graph} ( [:graph:]
According to the documentation : There is no way to block signals temporarily from
According the Perl documentation on regexes : By default, the "^" character is guaranteed
According to MSDN Documentation for partial classes : Partial methods are implicitly private So

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.