If I remember correctly the global should go inside to the def or else the def will create its own variable called var and not use you existent var global variable. It all has to do with the scope of the variable, python has inserted those rules to eliminate the global variable problem where names clash and before you know your programm start acting all crazy because you made a mistake that will be impossible to spot later. Those rules might seem annoying now, but will save you tons of debuging hours later by forcing you to use good programming practices.
The general attitude with global variables, is , dont use them.
If you look for easy route, best way is to use a class and create your variables in there. Then it will be dead easy to access your variables by classname.variablename syntax. This way you wont have to worry about scope or anything. Classes rock by the way, making code extremely easy to read and debug, highly recommend them , even for tiny porgramms.