Having a hard time finding a citation in official python docs but I declared the variable global so I can assign it. Found someone mentioning the same:

http://stackoverflow.com/a/4693170