views:

96

answers:

1

I have the following ini file

[Section]
value=test

When i use the ConfigParser Module :

import ConfigParser
config = ConfigParser.ConfigParser()
config.read('config.ini')
str=config.get('Section', 'value')

if str == 'test':
    print 1

else :
    print 0

it always print 0 could someone help

A: 

try

print str

and see what the value is.

James Geng
The value is test
ron
Try `if 'test' in str:`
Kimvais