我通過用戶輸入獲取一些數據,然後我必須在sqlite表中插入相同的數據。在sqlite表中插入Python腳本
conn = sqlite.connect('c:/sqlite/test.db')
c = conn.cursor()
c.execute("Select Max(person_id) from persons")
person_id =c.fetchone()[0]
person_name = input ("Please provide User Name: ")
user_id= input("Please user_id table: ")
home_floor = input ("Please provide home floor for user: ")
start_dt= input("Please enter start date (yyyy-mm-dd) for User : ")
end_dt = input ("Please enter end date (yyyy-mm-dd) for User: ")
c.execute('insert into Person values (%s,%s,%s,%s,%s,%s) person_id,person_name,user_id,home_floor,start_dt,end_dt)
瞭解如何創建[MCVE] –