@@ -0,0 +1,2302 @@
+#!/usr/bin/python%0A%0A# ==========================================================================%0A# Temparature Check and Alarm eMail Sender%0A# Forked from https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code%0A# Coded by fendergold, muster22@naver.com%0A# visit our Rasplay Site, www.rasplay.org%0A# 2014.05.09%0A# ==========================================================================%0A%0Aimport subprocess%0Aimport os%0Aimport re%0Aimport sys%0Aimport time%0Aimport datetime%0A%0A# ===========================================================================%0A# Google Account Details%0A# ===========================================================================%0A%0A# Account details for google docs%0Afrommail    = 'gmail_id@gmail.com' # Switch user gmail_id%0Atomail      = 'to_id@domain.com'  # Switch to_mail%0Auserid      = 'gmail_id'           # Switch user gmail_id%0Asmtp        = 'smtp.gmail.com'     # Do not change, if use gmail%0Apassword    = 'gmail_password'     # Switch user gmail_password%0A%0A# ===========================================================================%0A# Example Code%0A# ===========================================================================%0Aflag = 0%0A%0A# Continuously append data%0Awhile(True):%0A  # Run the DHT program to get the humidity and temperature readings!%0A%0A  output = subprocess.check_output(%5B%22../Adafruit-Raspberry-Pi-Python-Code/Adafruit_DHT_Driver/Adafruit_DHT%22, %2211%22, %2225%22%5D);%0A  print output%0A  matches = re.search(%22Temp =%5Cs+(%5B0-9.%5D+)%22, output)%0A  if (not matches):%0A%09time.sleep(3)%0A%09continue%0A  temp = float(matches.group(1))%0A%0A  # search for humidity printout%0A  matches = re.search(%22Hum =%5Cs+(%5B0-9.%5D+)%22, output)%0A  if (not matches):%0A%09time.sleep(3)%0A%09continue%0A  humidity = float(matches.group(1))%0A%0A  print %22Temperature: %25.1f C%22 %25 temp%0A  print %22Humidity:    %25.1f %25%25%22 %25 humidity%0A%0A%0A  if (temp %3E= 30):%0A         #str_mailbody = 'Temp is ' + temp + ' C, Humi is ' + humidity + '!!'%0A         str_mailbody = %22Temp is %25.2f C, Humidity is %25.2f %25%25!!%22 %25 (temp, humidity)%0A         str_cmd = %22sendemail -f %25s -t %25s -u temp warnning -m %25s -s %25s -xu %25s -xp %25s%22 %25 (frommail, tomail, str_mailbody, smtp, userid, password)%0A         if ( flag == 0 ):%0A             print (str_cmd)%0A             os.system(str_cmd)%0A             flag = 1%0A             print %22Sended Mail%22%0A  else:%0A         flag = 0%0A%0A  time.sleep(10)%0A

Create tempMailAlarm.py