calling a variable from a separate function

Wolfgang Grafen wolfgang.grafen at marconi.com
Thu Jul 19 05:18:04 EDT 2001


eric_brake wrote:
> 
> Let's say
> 
> def function1:
>      self.variable1 = 22
> def function2:
>      print variable1
> 
> Would function2 look like "print function1.variable1" or some other
> way? By the way I already know that the "function1.variable1" format
> doesn't work. thanks for any help.
class a:
  v = 22

def b():
  print v



More information about the Python-list mailing list