| Reply | « Previous Thread | Next Thread » |
|
Hello
I have an .ini (settings file) which contains following: Code:
[section1] item1=value item2=value [section2] item3=value I then run the following script (iniread.py): Code:
import sys
sys.path.append("E:\\")
import configobj
from configobj import ConfigObj
config = ConfigObj("test.ini")
section = config['section2']
value = section['item3']
print 'item3 : ' + value
Quote:
I also want to know how to read a file that is not in the same folder as configobj.py I tried with E:\\foldername\test.ini but I got a parse error in configobj.py... Thank you |
|
I lose the module. :-(
Can you link it for me? Thanks. Whirlwind |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
|
Quote:
|
|
Yes, I found it over at sourceforge here is the link:
http://sourceforge.net/projects/configobj I just took the configobj.py file and put it in E:\ |
|
The code I am using is pretty the same as the one in their example but I don't get why it won't work for me :\
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |