A simple lock coded in python.