PyPK wrote:
> hi how do I write this better with member variables rather than global
> as you see below.
> 
> eg:
> 
> test-flag = 0
> 
> class AA:
>    def __init__(...):
> 
>   def methos(self,...):
>        global test-flag
>        test-flag = xx
> 
> instead of something like above ..how do i put it i terms of member
> variables?

class AA:
    def __init__(...):
       self.test_flag = 0

   def methos(self,...):
        self.test_flag = xx

Note 'test-flag' is not a valid name.

Kent
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to