Create login_function.py

First attempt at the login script. This is a copy/paste from a gist. If you find this to be inaccurate, please go to https://gist.github.com/cadetdavis12/5616946