FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PythonTutorial/database.py at master · malekdev97/PythonTutorial · GitHub
malekdev97
/
PythonTutorial
Public
forked from
hussien89aa/PythonTutorial
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PythonTutorial
/
database.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (14 loc) · 624 Bytes
Breadcrumbs
PythonTutorial
/
database.py
Copy path
File metadata and controls
23 lines (14 loc) · 624 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import
sqlite3
def
main
():
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"
)
for
row
in
cusror
:
print
(
"Name:{}, Age:{}"
.
format
(
row
[
"Name"
],
row
[
"age"
]))
if
__name__
==
'__main__'
:
main
()
Back
|
FazBrowse Home
|
New Git URL