Only open the file when reading from it.

This utilizes a context manager to open and close the file for you - thusly not locking the file while the loop is sleeping.

Don't feel obligated to merge this - I just wanted to show a different way to approach file IO.  Plus a big part of OSS is to deny pull requests, so feel free to do so :)