json - Python - global variable is not defined (but it is) -
Then I am working on this file which converts CSV to JSON, however I get this error message I can not but understand that indentation seems right, so why have I lost it to go with it. The code is below: Traceback (the most recent call last): file "/ home / uwp / widgets / contentFreshness / freshmap Py ", line 308, & lt; Module & gt; In the file "/home/uwp/widgets/contentFreshness/freshmap.py", line 247, in the main () file "/home/uwp/widgets/contentFreshness/freshmap.py", line 303, main mySite.writeJSONFile (option) WriteJSONFile outputFile.write ('' + str (dateOfCrawl) + '' ') NameError: global name' dateOfCrawl 'is not defined code class site: dateOfCrawl = 0; Def __init __ (self, csvFilePath): self.pageList = [] # Page id self.pageData list ordered = {} page person dictionaries, = {} unique title of self-indexed on the # page page self.titleDict # dictionary. BuildPageData (csvFilePath) self.homePa...