- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.py
More file actions
Latest commit
18 lines (16 loc) · 393 Bytes
/
Copy pathbase.py
File metadata and controls
18 lines (16 loc) · 393 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
importsqlite3
defcreateDataBase():
con=sqlite3.connect('base.db')
cursor=con.cursor()
sqlStr="""
CREATE TABLE users (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
phone TEXT NOT NULL,
email TEXT UNIQUE NOT NULL)"""
try:
cursor.execute(sqlStr)
con.commit()
except:
pass
con.close()
createDataBase()