title: How do I check if 2 databases are opened or closed (one in sqlite3 and the other in MySQL) - Python 3.3?
body: <p>I have opened 2 databases, one in mysql (using mysql connector for Python) and another one in sqlite3 (using the standar sqlite3 module). My code requires that I constantly open and close the connections, but I don't know how to check if the connection is already open or closed. The documentation for MySQL says that there is an .open attribute that tells me so, but Python gives me an error when I try it. Also, can't I just do this:</p>
  
  <pre><code>connection1.close()
  connection2.close()
  
  if connection1.closed == True:
      connection1.open()
  </code></pre>
  
  <p>Thanks in advance</p>