March 5th, 2013, 12:15 PM
Multiple Scripts or Functions at Once
I am fairly new to coding, and am much better modifying others code to work for my own applications than to write my own from scratch.
I currently have been experimenting with the Raspberry Pi, specifically its control of the GPIO pins.
I have several python scripts that control different components (ex. temp sensor, light sensor, relays, push button). Each component is controlled by a separate script, and the relay one is controllable though a web interface.
What is a suitable (and efficient) method to consolidate all the scripts into one? Should I have each as a separate function, all in one large function? Something completely different?
Any help would be greatly appreciated. Thanks.
March 6th, 2013, 10:43 AM
I think the most "pythonic" way would be to have a master script that imports the various worker-bee scripts, as modules, and executes them in the order or upon events as appropriate.
March 11th, 2013, 02:15 PM
Thanks for the advice, I'll see what I can come up with!