From 4fd14684928e467969af0d3bf60bd1983b5e3460 Mon Sep 17 00:00:00 2001 From: zhangjianjun_code <7844966+zhangjianjun_code@user.noreply.gitee.com> Date: Wed, 9 Dec 2020 18:47:49 +0800 Subject: [PATCH 1/2] python cannot start normally --- cve-py/dbConnecttion/Config.py | 2 +- cve-py/dbConnecttion/MysqlConn.py | 2 +- cve-py/dbConnecttion/__init__.py | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cve-py/dbConnecttion/Config.py b/cve-py/dbConnecttion/Config.py index 9494399..dca181d 100644 --- a/cve-py/dbConnecttion/Config.py +++ b/cve-py/dbConnecttion/Config.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # -*- coding: UTF-8 -*- ################################################################################ diff --git a/cve-py/dbConnecttion/MysqlConn.py b/cve-py/dbConnecttion/MysqlConn.py index b346c49..5294314 100644 --- a/cve-py/dbConnecttion/MysqlConn.py +++ b/cve-py/dbConnecttion/MysqlConn.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # -*- coding: UTF-8 -*- ################################################################################ diff --git a/cve-py/dbConnecttion/__init__.py b/cve-py/dbConnecttion/__init__.py index c2f881e..96c381b 100644 --- a/cve-py/dbConnecttion/__init__.py +++ b/cve-py/dbConnecttion/__init__.py @@ -1,8 +1,3 @@ """ -Created on October 15, 2020 - -@author: xjh -1. When executing SQL with parameters, please use sql statement to specify the list of conditions that need to be entered, and then use tuple/list for conditional batch allocation -2. There is no need to use quotation marks to specify the data type in the format SQL, and the system will automatically recognize it according to the input parameters -3. There is no need to use conversion function in the input value, the system will automatically handle it + connect mysql """ \ No newline at end of file -- Gitee From 72fc9663a40b4ec9301158f7df0e9238b81353ec Mon Sep 17 00:00:00 2001 From: zhangjianjun_code <7844966+zhangjianjun_code@user.noreply.gitee.com> Date: Wed, 9 Dec 2020 19:03:15 +0800 Subject: [PATCH 2/2] python cannot start normally --- cve-py/dbConnecttion/MysqlConn.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cve-py/dbConnecttion/MysqlConn.py b/cve-py/dbConnecttion/MysqlConn.py index 5294314..b1c4032 100644 --- a/cve-py/dbConnecttion/MysqlConn.py +++ b/cve-py/dbConnecttion/MysqlConn.py @@ -21,7 +21,7 @@ Date: 10/22/2020 11:01 AM import pymysql from pymysql import cursors from DBUtils import PooledDB -from dbConnecttion import config +from dbConnecttion import Config class Mysql(object): @@ -45,11 +45,11 @@ class Mysql(object): """ if Mysql.__pool is None: __pool = PooledDB.PooledDB(creator=pymysql, mincached=1, - maxcached=20, host=config.DBHOST, - port=config.DBPORT, - user=config.DBUSER, - passwd=config.DBPWD, db=config.DBNAME, - use_unicode="UTF-8", charset=config.DBCHAR, + maxcached=20, host=Config.DBHOST, + port=Config.DBPORT, + user=Config.DBUSER, + passwd=Config.DBPWD, db=Config.DBNAME, + use_unicode="UTF-8", charset=Config.DBCHAR, cursorclass=cursors.DictCursor) return __pool.connection() return None -- Gitee