How do I declare global vars or class vars in Python ?

Linuxguy123 linuxguy123 at gmail.com
Tue Feb 17 09:54:40 EST 2009


How do I do this in Python ?

#############################
declare A,B

function getA
    return A

function getB
    return B

function setA(value)
     A = value

function setB(value)
     B = value

main()
    getA
    getB
    dosomething
    setA(aValue)
    setB(aValue)
############################

The part I don't know to do is declare the variables, either as globals
or as vars in a class.  How is this done in Python without setting them
to a value ?

Thanks	
    





More information about the Python-list mailing list