Spaces:
Sleeping
Sleeping
Download database.py from osmanYusuf/autoassistchatbot: direct link, hf CLI and curl.
- Browser
- Download file 467 Bytes
-
https://huggingface.co/spaces/osmanYusuf/autoassistchatbot/resolve/main/database.py
- Command line
-
hf download hf://spaces/osmanYusuf/autoassistchatbot/database.py
-
curl -L -o database.py https://huggingface.co/spaces/osmanYusuf/autoassistchatbot/resolve/main/database.py
467 Bytes
| import sqlite3 | |
| def create_connection(): | |
| conn = sqlite3.connect('database.db') | |
| return conn | |
| def create_table(): | |
| conn = create_connection() | |
| cursor = conn.cursor() | |
| cursor.execute(''' | |
| CREATE TABLE IF NOT EXISTS users ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| username TEXT NOT NULL, | |
| password TEXT NOT NULL | |
| ) | |
| ''') | |
| conn.commit() | |
| conn.close() | |
| if __name__ == '__main__': | |
| create_table() | |