Eclipse Python控制台无输出

时间:2018-08-09 07:43:54

标签: python eclipse

我尝试运行下面的代码,但是我的控制台在运行该程序后没有任何输出,我已经在同一IDE上使用sqlite3创建了类似的表,但是不明白为什么它没有输出

import sqlite3

def connect():
    conn = sqlite3.connect("Books.db")
    curr = conn.cursor()
    curr.execute("CREATE TABLE IF NOT EXISTS book(id INTEGER PRIMARY KEY, 
    title TEXT, author TEXT,year INTEGER, isbn INTEGER)")
    curr.commit()
    curr.close()


def ins(title,author,year,isbn): 
    conn = sqlite3.connect("Books.db")
    curr = conn.cursor()
    curr.execute("INSERT INTO book values(NULL,?,?,?,?)", 
    (title,author,year,isbn))  
    curr.commit()
    curr.close()


def see():
    conn = sqlite3.connect("Book.db")
    curr = conn.cursor()
    curr.execute("SELECT * FROM book")  
    rows= curr.fetchall()
    curr.close()
    return rows


    connect()

    ins("The Man", "John Tablet", 1967,9131003)  

    print(see())

0 个答案:

没有答案