14 lines
536 B
Python
14 lines
536 B
Python
import sqlite3
|
|||
|
|
c = sqlite3.connect('history.db')
|
||
|
|
c.execute('''CREATE TABLE IF NOT EXISTS agents (
|
||
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||
|
|
username TEXT UNIQUE,
|
||
|
|
password TEXT,
|
||
|
|
name TEXT
|
||
|
|
)''')
|
||
|
|
c.execute("INSERT OR IGNORE INTO agents(username,password,name) VALUES('admin','123','管理员')")
|
||
|
|
c.execute("INSERT OR IGNORE INTO agents(username,password,name) VALUES('agent1','123','客服小王')")
|
||
|
|
c.execute("INSERT OR IGNORE INTO agents(username,password,name) VALUES('agent2','123','客服小李')")
|
||
|
|
c.commit()
|
||
|
|
print("ok")
|