I'm new to Python (and programming in general), so please be patient.
I am doing some lab equipment automation, and I am looking for a way to toggle power on one piece of equipment while taking data on another piece of equipment. I want these events to be asynchronous to each other, i.e. I want the power to toggle randomly during the data-taking process.
I've checked out the following:
-time.sleep--I was actually able to use this successfully on one setup, because the power supply was so slow to respond--I told it to shut off, then slept a random amount of time, then started taking data on the other equipment. This relies on the power supply always reacting much more slowly than the other piece of equipment, which will generally not be the case.
-multiprocessing/threading--I've been reading about this on SO and python.org, but I'm still not clear on whether this will accomplish what I want. I tried to test it but I'm finding it difficult to code, and I don't want to invest more time in it if it's nowhere near to what I want.
So, in a nutshell: Will multiprocessing do what I want? Is there any other way to do this?