mysql_client.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:TickTickBacktest 作者: gavincyi 项目源码 文件源码
def connect(self, **kwargs):
        """
        Connect
        :param path: sqlite file to connect
        """
        host = kwargs['host']
        port = kwargs['port']
        user = kwargs['user']
        pwd = kwargs['pwd']
        schema = kwargs['schema']
        self.conn = pymysql.connect(host=host,
                                    port=port,
                                    user=user,
                                    password=pwd,
                                    db=schema,
                                    charset='utf8mb4',
                                    cursorclass=pymysql.cursors.SSDictCursor)
        self.cursor = self.conn.cursor()
        return self.conn is not None and self.cursor is not None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号