Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python call function in the same class

# Add the argument ".self" before your function's name --> line 12

class ThisClass:
  	def __init__(self):
  		self.a_random_arg = a_random_arg
    
    def FirstDef(self):
   		# Do your thing
      	# in this example, it returns a boolean
        
    def SecondDef(self):
    	if self.FirstDef(self) :
          # Do your thing again
 
PREVIOUS NEXT
Tagged: #python #call #function #class
ADD COMMENT
Topic
Name
3+6 =