Python: Importing a variable inside of a infinite loop
- by Jack
I have two modules, a host and a scanner. Both loop indefinitely to communicate with the serial ports. I want to import the variable "bestchannel" from scanner into host but by importing it, the while loop inside scanner runs first and loops forever. I want each module to run separately but be able to send each other data in real time. Is this possible?
(outside of scanning ram)
Example Code:
http://pastebin.com/pxUBaima
I want minchannel from scanner to be accessible to host.