Useful Python Programs, Modules and Code
This is the parent page for Python Programs, Modules and Code.
Updates to this page provide links to other posts that relate to coding techniques, standards and other information, topics and tips as they relate to the Python language and how Python is used on the Raspberry Pi.
To view the complete content, simply select the title.
This page presents a skeleton or template for Python programs.
This is intended to be used as a module. To test it just supply your specific email connection criteria and run the module from the command line.
This page presents a program that shuts down the OS when a button is pressed. The narrative is more about the problems associated with normally open button circuits and how they are managed using edge detection techniques.
This post presents a module that determines when the current time falls between a time range for given days of the week.
This page presents a Python program that is designed to be a proximity sensor operating on a local network using WIFI. This sensor employs a Passive Infrared sensor (PIR), an LED to give a visual indication that movement has been detected by the PIR, a Picamera and the program presented here.
The module presented is intended to be called by a program that is running as a service on a machine that is operating on a UPS. Its purpose is to detect when utility power has failed so that it can power down the machine. It does this by pinging either a router or another machine on the network either of which are not operating on a UPS.
This post shows how to use Python’s thread capabilities to launch asynchronous processes.
This post presents ZoneSentry.py. As the name implies it is a sentry application that uses a Passive Infrared (PIR) sensor in the same manner as the PIRLEDeMail.py program does. However, ZoneSentry.py is intended to replace PIRLEDeMail.py as it is now obsolete.