When I run my python script in PyCharm the whole script runs perfectly. However when it is run from a crontab, it only runs partially. Specifically to the end of the code un