TypeError:缺少一个必需的位置参数:‘Self’
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'
# test scriptfrom lib.pump import Pumpprint ("THIS IS A TEST OF PYTHON") # this printsp = Pump.getPumps()print (p)
import pymysqlclass Pump: def __init__(self): print ("init") # never prints def getPumps(self): # Open database connection # some stuff here that never gets executed because of error
慕沐林林
茅侃侃
Cats萌萌
相关分类