title: Python and sqlite3.ProgrammingError: Recursive use of cursors not allowed
body: <p>i wrote a python program like this that should run in multithreading mode:</p>
  
  <pre><code>def Func(host,cursor,db):
  
      cursor.execute('''SELECT If_index, Username, Version, Community, Ip_traff FROM HOST WHERE
      Hostname = ?''',(host,))
  
      #do something
  
  #--- Main ---
  
  db = sqlite3.connect(os.getcwd()+'\HOST', check_same_thread = False) #opendatabase       
  cursor = db.cursor()                                                 #generate a cursor
  
  for ii in range(len(host)):  #host is a list of ipaddress
  
      #for each host i want generate a thread
      thr = threading.Thread(target = Func, args=(host[ii],cursor,db) 
      thr.start()
  </code></pre>
  
  <p>i receive the sqlite3.ProgrammingError: Recursive use of cursors not allowed. How can i manage the recursive cursor for sqlite3 in this case? 
  thanks a lot
  Paolo</p>