Getting "ConfigParser.NoSectionError" while trying to read input from a file

Asked by saryu

W.R.T the discussion on https://answers.launchpad.net/sikuli/+question/204153,
I tried to read input from a file. Getting "ConfigParser.NoSectionError" . Please help

#my code
import ConfigParser
config = ConfigParser.ConfigParser()
config.read('config.ini')
my_username = config.get('user1','username')
my_address = config.get('user1','address')

#inside config.ini
[user1]
username = ABC
address = 123

[user2]
username = XYZ
address = 345

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

look into the docs of ConfigParser

Can you help with this problem?

Provide an answer of your own, or ask saryu for more information if necessary.

To post a message you must log in.