[python] python: NameError:global name '...‘ is not defined