global variables - how??

Matt Dunford kno at jtan.com
Thu Apr 13 02:02:32 CEST 2000


I usually set a module aside for global variables:

import glob_vars
glob_vars.count = 6

def printme( num ):
  print num

printme( glob_vars.count )

you get the idea...

"Anders Eggers-Krag" <aek at mail1.stofanet.dk> writes:

>how do I define a propper global variable that works in all functions in all
>modules?

>I have tried simply
>defining one outside of any function in the main module,
>I have tried using the global keyword under the same cicumstances,
>but they are not even avialible inside of functions within the main
>module...


>--
>Anders Eggers - Krag


--



More information about the Python-list mailing list