I can't move beyond the mistake:
Traceback (most recent call last):
File "C:\Users\Dom\Desktop\test\test.py", line 7, in <module>
p = Pump.getPumps()
TypeError: getPumps() missing 1 required positional argument: 'self'
I examined several tutorials but there doesn't seem to be anything different from my code. the sole thing I can consider is that python 3.3 requires a special syntax.
class Pump:
def __init__(self):
print("init") # never prints
def getPumps(self):
# Open database connection
# some stuff here that never gets executed because of error
pass # dummy code
p = Pump.getPumps()
print(p)
If I understand correctly, self is passed to the constructor and methods automatically. What am I doing wrong here?