0
我想在python Tkinter組合框中顯示來自sqlite3的特定列,但顯示的卻是<sqlite3.Cursor object at 0x0000000003E73110>
,我不知道該怎麼辦?我剛剛開始編寫代碼。無法在python上顯示sqlite3數據
我寫:
from tkinter import *
from tkinter import ttk
import sqlite3
conn = sqlite3.connect('Library.db')
c = conn.cursor()
c.execute("CREATE TABLE IF NOT EXISTS tablename (Name TEXT UNIQUE NOT NULL)")
combolist = c.execute("SELECT Name FROM tablename")
root = Tk()
ttk.Combobox(root, value = (combolist))
嘗試'combolist = c.fetchall()'獲得調用結果到'execute'。 – Duncan