title: Setting up the configuration of sqlite3 database in Python SQLITE_CONFIG_MULTITHREAD
body: <p>As per the sqlite3 documentation <a href="http://www.sqlite.org/compile.html#threadsafe" rel="nofollow">http://www.sqlite.org/compile.html#threadsafe</a>: </p>
  
  <blockquote>
    <p>"When SQLite has been compiled with SQLITE_THREADSAFE=1 or
    SQLITE_THREADSAFE=2 then the threading mode can be altered at run-time
    using the sqlite3_config() interface together with one of these verbs:</p>
  
  <pre><code>SQLITE_CONFIG_SINGLETHREAD
  SQLITE_CONFIG_MULTITHREAD
  SQLITE_CONFIG_SERIALIZED "
  </code></pre>
  </blockquote>
  
  <p>Can you please help me with the proper Python syntax for configuring a database with SQLITE_THREADSAFE=1 and SQLITE_CONFIG_MULTITHREAD</p>
  
  <p>Thank you for reading, and apologies for filling up stackoverflow with such a basic problem.</p>
  
  <p>BTW, if it matters at all, what I am doing is, I have multiple threads running, and in each I have a several calls to different database connections. The python script worked well when running on the windows machine I originally wrote it on, but now that I have migrated it to an Ubuntu machine I get "ProgrammingError: SQLite objects created in a thread can only be used in that same thread.." I tried connecting with check_same_thread = False but then I get an error that the database is locked. This is why I need to see if the configs above may help solve my problem, I just have trouble with their syntax.</p>