29 lines
616 B
Python
Executable File
29 lines
616 B
Python
Executable File
import sqlite3
|
|
|
|
try:
|
|
sqliteConnection = sqlite3.connect('dbstocks.sqlite')
|
|
cursor = sqliteConnection.cursor()
|
|
print("Successfully Connected to SQLite")
|
|
|
|
except sqlite3.Error as error:
|
|
print("Error while executing sqlite script", error)
|
|
|
|
cursor.execute('SELECT * from dailystocks')
|
|
|
|
rows = cursor.fetchall()
|
|
|
|
for row in rows:
|
|
print(row)
|
|
|
|
|
|
|
|
#conn = sqlite3.connect('stocks_db.sqlite')
|
|
|
|
#cur = conn.cursor()
|
|
#selecttest = 'SELECT * from dailystocks'
|
|
#cur.execute('SELECT * from dailystocks')
|
|
#cur.execute('CREATE TABLE experiments (name VARCHAR, description VARCHAR)')
|
|
#conn.commit()
|
|
|
|
#conn.close()
|