Good afternoon!
I am currently working on a few different Python projects. One, a desktop assistant, will be a voice-controlled device containing a Raspberry Pi connected to a USB mic, speakers and a webcam, and an Arduino Pro Micro connected to pan/tilt servos and an ultrasonic sensor. The other is a Pi-based Media player.
Both projects would benefit from having a modular coding structure where modes/features/services can be simply placed into a 'Service Folder' and used by the main code when there.
For example; the Assistant would handle voice control in it's main script, however I would use a folder to allow the addition of configurations for different environments (Standalone, attached to work PC, attached to home PC, home media centre etc). these configurations would define key words and functions that are unique to that setup.
The media centre would be very similar to that of elParaguayo's PI info screen project viewtopic.php?f=41&t=121392 , where he uses 'plugins' to add features and different screens to his project.
I would like to use the same style to add various functions (Clock, a TV-like function etc) by dropping them into a folder.
The TV function would again feature a drag-and-drop folder to add channels (specific playlists) for the main script to cycle through when the user presses up and down.
I am after some advice regarding the best way to set about coding in a modular fashion. Any insight, advice or examples would be greatly appreciated!
Thanks very much
Craig