import sys, ConfigParser
from os.path import *
#print sys.path
filnam = "~/.thancad"
filnam1 = expanduser(filnam)
print filnam, "->", filnam1
filnam = "~mafalda/.thancad"
filnam1 = expanduser(filnam)
print filnam, "->", filnam1
d = {"x":1, "y":2}
#d = ["a", "b"]
c = ConfigParser.RawConfigParser(d)
c.read("dokfil.ini")
print "\n\n"
print c.defaults()
print c.sections()
print c.options("thanasis")
print c.options("other")
for sec in c.sections():
print "Section", sec
for opt in c.options(sec):
print "option", opt, "=", c.get(sec, opt)
c.write(file("q1", "w"))
|