title: How to write something to sqlite database?
body: <p>I always got this error when I trying to run my python script:</p>
  
  <blockquote>
    <p>c.execute("INSERT INTO test (word) VALUES (?)", (word))
    sqlite3.ProgrammingError: Incorrect number of bindings supplied. The
    current statement uses 1, and there are 4 supplied.</p>
  </blockquote>
  
  <p>Any idea what is the problem?</p>
  
  <pre><code>import itertools, time, sqlite3
  
  def main():    
      try:
          print ("Still running, please wait...")
          start_time = time.time()
  
          con = sqlite3.connect("dictionary.db")
          c = con.cursor()
          c.execute("CREATE TABLE test (string char(10))")
  
          for word in itertools.imap(''.join, itertools.product('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@&amp;#!*', repeat=4)):
              c.execute("INSERT INTO test (word) VALUES (?)", (word))
              con.commit()
  
      finally:
          print ("Done! Check the txt file!\n")
          end_time = time.time()
          print "Processing time was: ", end_time - start_time
  
  if __name__ == "__main__": main()
  </code></pre>