Local variable referenced before assignment in Python?
问题 I am using the PyQt library to take a screenshot of a webpage, then reading through a CSV file of different URLs. I am keeping a variable feed that incremements everytime a URL is processed and therefore should increment to the number of URLs. Here\'s code: webpage = QWebPage() fo = open(\"C:/Users/Romi/Desktop/result1.txt\", \"w\") feed = 0 def onLoadFinished(result): #fo.write( column1[feed])#, column2[feed], urls[feed]) #feed = 0 if not result: print \"Request failed\" fo.write(column1