title: python & Mysql: unsupported operand type(s) for -: 'int' and 'tuple'
body: <p>I would like to fetch a record from a table and put it in the variable "gl".
  if value is bigger or smaller then value+-gl it should write into the database</p>
  
  <pre><code>import MySQLdb
  import time
  import string
  
  
  while True:
    db = MySQLdb.connect(host="10.0.0.100", port=3306, user="ubuntu", passwd="ubuntu", db="test")
    cursor = db.cursor()
    cursor.execute("SELECT glaettung FROM ttable ORDER BY id DESC LIMIT 1")
    gl = cursor.fetchall()
    print gl
    value = (20)
    if (value &lt; (value-gl)):
      cursor = db.cursor()
      cursor.execute("INSERT INTO ttable (value) VALUES(%s)", (value))
    elif (value &gt; (value+gl)):
      cursor = db.cursor()
      cursor.execute("INSERT INTO ttable (value) VALUES(%s)", (value))
    else:
      print "Done"
  </code></pre>
  
  <p>This is the error:</p>
  
  <pre><code>ubuntu@ubuntu-Aspire-6920:~/Dokumente$ python test.py 
  (('2',),)
  Traceback (most recent call last):
    File "test.py", line 13, in &lt;module&gt;
      if (value &lt; (value-gl)):
  TypeError: unsupported operand type(s) for -: 'int' and 'tuple'
  </code></pre>