Advertisement
Guest User

Fill cache

a guest
Oct 22nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. # Should be code not name, e.g. MSFT
  2. import sqlite3
  3.  
  4. def add_table(stockcode):
  5.     conn = sqlite3.connect('app/static/db/cache.db')
  6.     c = conn.cursor()
  7.     c.execute("CREATE TABLE [symbol_{}] (title text, permalink text, score integer, created real)".format(symbol))
  8.     conn.commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement