我的错误
File "controller.py", line 26
try:
^
IndentationError: expected an indented block
我的代码:
def main():
config=ConfigParser.ConfigParser()
config.readfp(open("settings.cfg"),"r")
for site in config.sections():
# ipdb.set_trace()
settings=dict(config.items(site))
with open('shoes.txt') as fp: <--new code trying to add
for category, url in csv.reader(fp): <--new code trying to add
#ipdb.set_trace()
#print url,category
try: <--line 26
出于某种原因,我收到错误,我不确定如何解决它你能帮我吗?
我有一个旧的,效果很好:
def main():
config=ConfigParser.ConfigParser()
config.readfp(open("settings.cfg"),"r")
for site in config.sections():
# ipdb.set_trace()
settings=dict(config.items(site))
for (url,category) in zip(settings['url'].split(","),settings['category'].split(",")):
#ipdb.set_trace()
#print url,category
try:
... more code