title: mails send if condition is true using python code
body: <p>we setup raspberry pi to measure server room temperature and save the out put in text file in this format <code>"Temp: 24.0 C  Humidity: 67.0 %"</code> (updates every 2 seconds) using python script . </p>
  
  <p>now I am looking for python code to read temperature value (e.g 24.0) from text file and send me a emails if condition is true like(Temp>35.0) else do nothing and exit.</p>
  
  <p>I am new in python so please help me out , we have already written emails code and its working , just enable the requested above condition in this below code.</p>
  
  <pre><code>import smtplib
  from email.MIMEMultipart import MIMEMultipart
  from email.MIMEText import MIMEText
  fromaddr = "sender@gmail.com"
  toaddr = "recipient@gmail.com"
  msg = MIMEMultipart()
  msg['From'] = fromaddr
  msg['To'] = toaddr
  msg['Subject'] = "Alert: Server Room  " 
  body = "Server room current temprature is : "
  msg.attach(MIMEText(body, 'plain'))
  server = smtplib.SMTP('smtp.gmail.com', 587)
  server.starttls()
  server.login(fromaddr, "password")
  text = msg.as_string()
  server.sendmail(fromaddr, toaddr, text)
  server.quit()
  </code></pre>
  
  <p>This scripts will be run using <code>cron</code> tab. </p>