Page Menu
Home
Miraheze
Search
Configure Global Search
Log In
Paste
P383
read_db.py
Active
Public
Actions
Authored by
Paladox
on Feb 9 2021, 23:16.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F1391152: read_db.py
Feb 9 2021, 23:16
2021-02-09 23:16:31 (UTC+0)
Subscribers
None
#! /usr/bin/python3
import
sqlite3
,
csv
conn
=
sqlite3
.
connect
(
'/home/southparkfan/resp_time.db'
)
cur
=
conn
.
cursor
()
cur
.
execute
(
"SELECT * FROM 'resp_time';"
)
rows
=
cur
.
fetchall
()
with
open
(
"resp_time.csv"
,
"wb"
)
as
write_file
:
for
row
in
rows
:
writeRow
=
","
.
join
([
str
(
i
)
for
i
in
row
])
write_file
.
write
(
writeRow
.
encode
()
+
"
\n
"
.
encode
())
Event Timeline
Paladox
created this paste.
Feb 9 2021, 23:16
2021-02-09 23:16:31 (UTC+0)
Log In to Comment