python 中使用with簡化MySQL 和 Socket 的鏈接

數據庫 : from pymysql import * class DB(object): def __init__(self): self.conn = connect(host='localhost', port=3306, database='python_test_1', user='root', password='mysql', charset='utf8')
相關文章
相關標籤/搜索