python中的SQLite3 - 无法输出

时间:2013-11-28 11:49:14

标签: sqlite

我在python中遇到SQL问题,我只是创建一个表,我想打印出来。我很困惑D:我正在使用python 3.x

import sqlite3 


print ("-" * 80)
print ("-                        Welcome to my Address Book                     -")
print ("-" * 80)


new_db = sqlite3.connect('C:\\Python33\\test.db')
c = new_db.cursor()


c.execute('''CREATE TABLE Students
(student_id text,
student_firstname text,
student_surname text,
student_DOB date,
Form text)
''')

c.execute('''INSERT INTO Students
          VALUES ('001', 'John','Doe', '12/03/1992', '7S')''')
new_db.commit()
new_db.close()



input("Enter to close")

0 个答案:

没有答案
相关问题