Spaces:
Paused
Paused
Download app5_selectbox/database_con.py from MENG21/studfaceval: direct link, hf CLI and curl.
- Browser
- Download file 424 Bytes
-
https://huggingface.co/spaces/MENG21/studfaceval/resolve/main/app5_selectbox/database_con.py
- Command line
-
hf download hf://spaces/MENG21/studfaceval/app5_selectbox/database_con.py
-
curl -L -o database_con.py https://huggingface.co/spaces/MENG21/studfaceval/resolve/main/app5_selectbox/database_con.py
424 Bytes
| # # database.py | |
| # import mysql.connector | |
| # # Connect to your MySQL database | |
| # db_connection = mysql.connector.connect( | |
| # host="localhost", | |
| # user="root", | |
| # password="", | |
| # database="university_evaluation_5" | |
| # ) | |
| # cursor = db_connection.cursor() | |
| #### for sqlite connection #### | |
| import sqlite3 | |
| db_connection = sqlite3.connect('database/data.sqlite', check_same_thread=False) | |
| cursor = db_connection.cursor() | |