thanks, but I'm not planning on using tkinter( i kind of hated using it) i'm sticking to just text based commands and a python script. also plotting may or may not be done, since it would have to depend on what is being called. Also the pyserial part has priority so i dont want anything to slow it down.
here is the solution found on stackoverflow from the user Carcigenicate
here is the solution found on stackoverflow from the user Carcigenicate
from operator import methodcaller class Spawn: def __init__(self, _number, _max): self._number = _number self._max = _max # Don't call update here def request(self, x): print("{} was requested.".format(x)) def update(self): while True: print("Spawned {} of {}".format(self._number, self._max)) sleep(2) if __name__ == '__main__': spawn = Spawn(1, 1) # Create the object as normal p = multiprocessing.Process(target=methodcaller("update"), args=(spawn,)) # Run the loop in the process p.start() spawn.request(2) # Now you can reference the "spawn" object to do whatever you like