github / github/codespaces-jupyter
screen
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 894
- Fork
- 1.7k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
import mysql.connector
from contextlib import contextmanager
DB_CONFIG = {
"host": "localhost",
"user": "root",
"password": "",
"database": "School_Fees_DB"
}
@contextmanager
def get_db():
conn = mysql.connector.connect(**DB_CONFIG)
cursor = conn.cursor(dictionary=True)
try:
yield cursor
conn.commit()
except Exception as e:
conn.rollback()
raise e
finally:
cursor.close()
conn.close()
Hướng dẫn đóng góp
Hướng nghiên cứu
The issue contains only a code snippet and does not identify a repository file, test, failing behavior, or requested change. Clarify the intended outcome and provide reproduction steps before selecting an entry point or defining what done means.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- mysql, python
- Lĩnh vực
- databases
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 5/100