In Python you can write procedural code, or object oriented code.

class myClass():
  def method1(self):
    print "myClass method1"
 
  def method2(self, someString):
    print "myClass method2: " + someString
 
def main():
  x = 0
 
# exercise the class methods
  c = myClass()
  c.method1()
  c.method2("This is a string")
 
if __name__ == "__main__":
  main()

Note the class is defined above main. Main is the program that will run when this file is called from the command line. So, inside main we create an instance of the class and call methods on the class. The class definition is independant of that...

If the class is dependant on anything it can go in the brackets class myClass():

Ussually the first argument to a class method is self def method1(self): self will refer to the particular instance of the class that is being operated on...

After you instantiate a class and call a method on that instance it is not necessary to pass selfas an argument to the method.

6.1 Inheritance

class myClass():
  def method1(self):
    print "myClass method1"
 
  def method2(self, someString):
    print "myClass method2: " + someString
 
class anotherClass(myClass):
  def method2(self):
    print "anotherClass method2"
 
  def method1(self):
    myClass.method1(self);
    print "anotherClass method1"
 
def main():
  x = 0
 
# exercise the class methods
  c = myClass()
  c.method1()
  c.method2("This is a string")
 
# exercise the class methods
  c2 = anotherClass()
  c2.method1()
 
if __name__ == "__main__":
  main()

In this code above anotherClass inherits from myClass class anotherClass(myClass):

method2 and method1 from myClass are overridden in anotherClass.

also,

  def method1(self):
    myClass.method1(self);
    print "anotherClass method1"

inside method1 of anotherClass we are calling method1(self); on the super class or the class anotherClass inherits from - myClass, before we print "anotherClass method1"