title: Can't access sqlite3 database from python 3.4.2 scripts
body: <p>I am trying to write create a sqlite3 database using python 3.4.2 called "podcasts". I created two files: </p>
  
  <p>dbcreate.py:</p>
  
  <pre><code>import sqlite3 as db
  
  conn = db.connect('test.db')
  cursor = conn.cursor()
  cursor.execute("create table podcasts(name text, hosts text, channel text)")
  print("table created")
  </code></pre>
  
  <p>dbinsert.py: </p>
  
  <pre><code>import sqlite3 as db
  
  conn = db.connect('test.db')
  cursor = conn.cursor()
  cursor.execute('insert into podcasts values("Invisibilia","NPR", "Lulu Miller and Alix Spiegel")')
  cursor.execute('insert into podcasts values("Hanselminutes", "independent", "Scott Hanselman")')
  conn.commit()
  conn.close()
  </code></pre>
  
  <p>When I ran the module for dbcreate.py, it printed "table created" like it should. But when I ran the module for dbinsert.py, I got no output. So I then went to the command line on my Macbook Air and when I entered the python3.4 shell and wanted to access both files from the command line, I got:</p>
  
  <pre><code>&gt;&gt;&gt; dbcreate.py
  Traceback (most recent call last):
    File "stdin", line 1, in module
  NameError: name 'dbcreate' is not defined
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>&gt;&gt;&gt; dbinsert.py
  Traceback (most recent call last):
    File "stdin", line 1, in module
  NameError: name 'dbinsert' is not defined
  </code></pre>
  
  <p>When I tried accessing the database from sqlite3 in the command line by typing in .databases, I get: </p>
  
  <p><img src="https://i.stack.imgur.com/23DL7.png" alt=""></p>
  
  <p>I don't know how to access the database I created in dbinsert.py so I would appreciate any help you can give me. Thank you. </p>