title: SyntaxError: 'return' outside function?
body: <p>I want to return 2 values : the first one is data read from sensor connected to raspberry and the second one is current time </p>
  
  <p>rasp.py</p>
  
  <pre><code>#!/usr/bin/env python
  from datetime import datetime
  class ReturnValue(object):
    __slots__ = ["x","y"]
    def __init__(self,x,y):
      self.x = x
      self.y = y
  
  def foo ( ) :
    i = 0 
    for i in range(0,19):
       i += 1
       tfile = open("/sys/bus/w1/devices/28-000007101990/w1_slave")
       text = tfile.read()
       tfile.close()
       secondline = text.split("\n")[1]
       temp = secondline.split(" ")[9]
       temperature  = float(temp[2:])
       temperature = temperature/1000
       mystr = str(temperature)
       y =  mystr.replace(",",".")
       x = datetime.datetime.now().time() 
  return  ReturnValue(x, y) 
  </code></pre>