global variable warning in python
global variable warning in python Question: I have a python 2.6 script (yes I know I should upgrade to at least 2.7) that looks like this: ret_code = 0 def some_func() global ret_code … if __name__ == ‘__main__’: global ret_code … Now I get a warning if I run the code: *SyntaxWarning: name ‘ret_code’ is …