title: Raspberry Pi Crontab script error
body: <p>I have the following script on a Raspberry Pi to send an SMS. It runs if I type: python tides_sms.py</p>
  
  <p>The problem is, I can't get it to run via Crontab (* * * * * /usr/bin/python /home/pi/python_files/tides_sms.py). The file is set to: rwxr-xr-x</p>
  
  <p>When I add code to write to a file, the file gets created via Crontab, but it won't send an SMS.</p>
  
  <p>Any help appreciated.</p>
  
  <hr>
  
  <pre><code>#!/usr/bin/python
  
  from twilio.rest import TwilioRestClient
  
  # Your Account Sid and Auth Token from twilio.com/user/account
  account_sid = "**********************************"
  auth_token = "********************************"
  
  with open("tide_data.txt", "r") as file:
      tides_array = file.read().splitlines()
  
  tides_array.reverse()
  
  elements = tides_array[0].split(' | ')
  
  string=''
  for element in elements:
      string = '\n'.join([string, element])
  
  client = TwilioRestClient(account_sid, auth_token)
  
  message = client.sms.messages.create(body="Text from PI:\nTIDES" + string,
      to="+44??????????",
      from_="+44??????????")
  </code></pre>