What does non-existent method start mean? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: What does non-existent method start mean? (/thread-17229.html) |
What does non-existent method start mean? - StanHuang - Apr-03-2019 I am new and hadn't write any python program before. Now, I was assigned to take over a finished program. I found codes in main.py as: #!/usr/bin/python3 from qr_validator import QRValidator def main(): app = QRValidator() app.start() if __name__ == "__main__": main()The code snippet in qr_validator.py is: import threading from modules.pydispatch import dispatcher from modules.mitac.socket_broker import SocketBroker as BROKER from modules.mitac.application import Application from sc_client import SCClient from modules.mitac.reader.qr_reader import QRReader class QRData(): val = None @classmethod def is_valid(cls, data): return data == b'{ACK}\x00' ..... class QRValidator(Application): SIGNAL_QR_CODE_ENTER = "QR_Code_Enter" def gen_broker_message(self, msg_type, message): jmessage = self._gen_post_jmessage(msg_type, message) message = self._gen_post_message(msg_type, jmessage) return message def handle_message(self, sender, signal, message): ....I didn't find 'start' method at qr_validator.py. So, my questions are: 1) how come start appears in main.py / app.start 2) Why is classmethod in QRData appendix with a '@'? RE: What does non-existent method start mean? - StanHuang - Apr-03-2019 How can I edit it? Thanks. RE: What does non-existent method start mean? - StanHuang - Apr-03-2019 'start' is a method of base class of QRValidator, Application. That's my mistake. Sorry. RE: What does non-existent method start mean? - nilamo - Apr-03-2019 Thanks for coming back with the answer :) |