- Notifications
You must be signed in to change notification settings - Fork 731
Expand file tree
/
Copy pathdatabase.py
More file actions
Latest commit
23 lines (14 loc) · 624 Bytes
/
Copy pathdatabase.py
File metadata and controls
23 lines (14 loc) · 624 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
importsqlite3
defmain():
db=sqlite3.connect("information.db")
db.row_factory=sqlite3.Row
db.execute("create table if not exists Admin(Name text,age int)")
db.execute("insert into Admin (Name,age) values (? , ?)",("Hussein",26))
db.execute("insert into Admin (Name,age) values (? , ?)",("Jena",1))
db.commit()
#db.execute("delete from Admin where name='Jena'")
#db.execute("Update Admin set age=2 where name='Jena'")
cusror=db.execute("select * from Admin")
forrowincusror:
print("Name:{}, Age:{}".format(row["Name"],row["age"]))
if__name__=='__main__':main()