title: How to test if a table already exists?
body: <p>I'm working on a scrabblecheat program</p>
  
  <p>Following some examples I have the following code below which uses SQLite for a simple database to store my words.</p>
  
  <p>However it tells me I can't recreate the database table.</p>
  
  <p>How do I write in a check for if there is already a table named <code>spwords</code>, then skip trying to create it?</p>
  
  <p><strong>The error:</strong></p>
  
  <pre><code>(&lt;class 'sqlite3.OperationalError'&gt;, OperationalError('table spwords already exists',), None)
  </code></pre>
  
  <p><strong>The Code:</strong></p>
  
  <pre><code>def load_db(data_list):
  
  # create database/connection string/table
  conn = sqlite.connect("sowpods.db")
  
  #cursor = conn.cursor()
  # create a table
  tb_create = """CREATE TABLE spwords
                  (sp_word text, word_len int, word_alpha text, word_score int)
                  """
  conn.execute(tb_create)  # &lt;- error happens here
  conn.commit()
  
  # Fill the table
  conn.executemany("insert into spwords(sp_word, word_len, word_alpha, word_score) values (?,?,?,?)",  data_list)
  conn.commit()
  
  # Print the table contents
  for row in conn.execute("select sp_word, word_len, word_alpha, word_score from spwords"):
      print (row)
  
  if conn:
      conn.close()
  </code></pre>