Python/Class
From EventScripts Community Encyclopedia
|
[edit] classPython Module: core [edit] DescriptionThis is a part of the core Python syntax and does not require importing a module to use Class allows the creation of a class in python. Anything within the indentation scope after the class call is included in that class by the Python interpreter [edit] Syntaxclass <name>(<type>):
[edit] Examples# Demonstrating class creation and what is 'in' the class and what 'isn't' class my_class(object): avar = 'a class variable' def __init__(self): #this tab level is inside the __init__ function of the classs pass def newfunc(self): # this is a new function in the class pass def notinclass() # This function is NOT included in the class pass [edit] Notes
|
|
