title: Appengine won't display Python function
body: <p>I have a really simple program that checks the date and returns if the combined <em>month+day+year</em> is a so called <strong><em>happy number</em></strong> (a number whos sum of the square of its digits equal one) or not.<br>
  The program works fine when I run it locally through python but when I try to run it through the appengine, either locally or online, nothing is displayed but a single TEST print line.<br>
  I can't figure out why the appengine will not display the function.</p>
  
  <p>Any help or suggestions would be really appreciated as I'm stuck.<br>
  The appengine logs show a GET request:</p>
  
  <pre><code>" INFO     2011-04-14 18:19:14,981 dev_appserver.py:3317] "GET / HTTP/1.1" 200 -"
  </code></pre>
  
  <p>but nothing afterwards.</p>
  
  <pre><code>import sys
  import datetime
  
  def main():
      date = datetime.date.today()
      datearray=[0,0,0]
      datearray[0]=str(date.month)
      datearray[1]=str(date.day)
      datearray[2]=str(date.year)
      joined = ''.join(datearray)
      print "Date:",int(joined)
      print happynums(int(joined))
  
  def happynums(num):
      total = int(num)
      varnum = 0
      bin=0    
      x=0
      past=set()
  
      while total!=1:
          if total in past:
              return "Sad day :("
          past.add(total)
          list = map(int,str(total))
          total=0
          for i in list:
              total = total + i**2
          if total==1:
              return "Happy day :)"
  
  if __name__ == '__main__': 
      main()
      print "TEST"
  </code></pre>