Python 2.7 - Classes
I'm trying to edit a library in python (perfmon) - the file is session.py I want to add a module that can record some readings from a USB port. This is also my first trial with cla
Solution 1:
You can not return anything (besides None) from a class constructor.
otherwise one will get
TypeError: __init__() should returnNone
Solution 2:
as I understand in Your case answer is
>>>from perfmon import session>>>test = session.USB()
But this way You move is wrong. You should create your own module in your workspace/project dir. Import session module and Create class there
from perfmon import session
classUSB(Session):
def__init__(self):
pass#I have changed this part as It has two errors in your example
Post a Comment for "Python 2.7 - Classes"