class PS():
def __init__(self):
self.PSU_thread=Process(target=self.read(199),)
self.PSU_thread.start()
def read():
while running:
"read the power supply"
def set(current):
"set the current"
if __name__ == '__main__':
p=PS()
Basically the idea of the code is to read the data of the power supply and at the same time to have the IDLE active and can accept command to control it set(current)
. The problem we are having is once the object p is initialized, the while loop will occupy the IDLE terminal such that the terminal cannot accept any command any more.
We have consider to create a service, but does it mean we have to make the whole code into a service?
Please suggest me any possible solutions, we want it to run but still be able to receive my command from IDLE.