Update playwright/README.md
This commit is contained in:
@@ -42,11 +42,11 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
# db.py
|
# db.py
|
||||||
import sqlite3, json
|
import sqlite3, json, os
|
||||||
|
|
||||||
class DB(sqlite3.Connection):
|
class DB(sqlite3.Connection):
|
||||||
def __init__(self, db_name=".db.sqlite"):
|
def __init__(self, db_name=".db.sqlite"):
|
||||||
super().__init__(db_name)
|
super().__init__(os.path.expanduser(db_name))
|
||||||
with self:
|
with self:
|
||||||
self.execute('''
|
self.execute('''
|
||||||
CREATE TABLE IF NOT EXISTS kv_store
|
CREATE TABLE IF NOT EXISTS kv_store
|
||||||
@@ -105,7 +105,7 @@ class DB(sqlite3.Connection):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
db = DB()
|
db = DB('~/db.sqlite')
|
||||||
|
|
||||||
# 문자열 저장 및 조회
|
# 문자열 저장 및 조회
|
||||||
db["hello"] = "world"
|
db["hello"] = "world"
|
||||||
|
|||||||
Reference in New Issue
Block a user