TypeError: function takes 2 positional arguments but 3 were given
问题 I'm trying to create a seperate class for MQTT subscribe and publish for a LoPy device, written in micropython. This is my code of main.py: import pycom import time import communicationmod pycom.heartbeat(False) if __name__ == '__main__': communication = communicationmod.Com() while True: communication.update() print (communication.getmessage()) time.sleep(1.00) And this is the code of communicationmod.py: import pycom import time from umqtt import MQTTClient import machine import ujson class