赞
踩
python使用的docker
- 准备如下文件,并加上可执行权限。
- ./build.sh 创建镜像
- ./run.sh 运行容器
- docker exec -it py3.7 bash 进入容器
-
- 将下述文件放在同一个目录
- Dockerfile code pip.conf run.sh sources.list build.sh
-
- build.sh如下
- docker build -t test_python:3.7 .
-
- Dockerfile如下
- FROM python:3.7
-
- #定义构建的名称
- #ARG buildversion
-
- COPY ./sources.list /etc/apt/sources.list
- COPY ./pip.conf /etc/
-
- RUN echo 'Asia/Shanghai' >/etc/timezone \
- && apt-get update -y \
- && apt-get install vim -y \
- && apt-get install tree -y \
- && apt-get install zip -y \
- && apt-get install unzip -y \
- && apt-get install net-tools -y \
- && pip install xlsxwriter \
- && pip install openpyxl \
- && pip install xlrd \
- && pip install numpy scipy matplotlib \
- && pip install pytest \
- && pip install pytest-html \
- && pip install pandas \
- && pip install robotframework \
- && pip install requests \
- && pip install collection \
- && pip install robotframework-httplibrary \
- && pip install RESTinstance \
- && pip install docker \
- && pip install pyyaml \
- && pip install tornado \
- && pip install flask \
- && pip install gevent \
- && pip --default-timeout=100 install pyyaml -i https://pypi.tuna.tsinghua.edu.cn/simple
-
-
- pip.conf 如下
- [global]
- index-url = https://pypi.tuna.tsinghua.edu.cn/simple
-
-
- run.sh 如下
- docker run -dit --privileged=true --network host --restart=on-failure --name=py3.7 -v $PWD:/test test_python:3.7 sh -c 'sleep 36000000000'
-
- sources.list 如下
- deb http://mirrors.ustc.edu.cn/debian buster main contrib non-free
- deb http://mirrors.ustc.edu.cn/debian buster-backports main contrib non-free
- deb http://mirrors.ustc.edu.cn/debian buster-proposed-updates main contrib non-free
- deb http://mirrors.ustc.edu.cn/debian-security buster/updates main contrib non-free
-
将下属文件放在一个目录下,如code目录
tornado web服务
- # -*- coding: UTF-8 -*-
-
-
- imgBaseNoN="/9j/4AAQSkZJRgABAQEAYABgAAD/4QBaRXhpZgAATU0AKgAAAAgABQMBAAUAAAABAAAASgMDAAEAAAABAAAAAFEQAAEAAAABAQAAAFERAAQAAA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+3ehgHTOf0pV6c9aB0zikByMUr6ASZweKT8SaQFgMgA0wSY68/0qLlIlPHAxQo3Y9e1NY5HX6U+M/MKGwtqegeGF/cjjnFdjbnaMmuW8LJutlIJOBXTZ8tM1izrjsSyOu7k0+OUbW57VlyTHecUecyjrQXcttIFn684qWeUNCCT2rM3szbs5pZJWyoBoFcbKwAYg1t6K/7hfesGfmI5GDW3oufIWm0JPU03JL1Qll/fjBq3M+CT6VkSS5uCAaRd7GvvwnXpTUcE1U85jGM96dE3ylvSpsMdeSKE5NVYZOT3rN1a/Mbbc1n22qgEE9Ce1HKw5kdOZsUVjrqKMM4/M0UcrDnR5Ae9NoorsPNCl70UUAL/CfpSD7lFFACJ1apF+6PrRRQVEVe9ObqtFFA1uQt96nHov0NFFZjIv8AGk/hFFFNE9RE6mlH3qKKJbi6kw6r9aWX7y/SiikWaHh7/j7m/wB2u0tv+PCL/gP/AKLNFFJmsdjl3+4Pq/8A6EabD/rl/wCugoopgXNI/wCQjH/19j+tTat/x+N/vf8AstFFJ7jN74bf8hDUf91f5mvSD/q6KK5KnxM76PwI8p+IH/H2v/XJP/QzWPofWP8A6/jRRSf8NhH+Keha1/yCLz/rg38q8vf7kf8AuiiitMPsY4v4hj/cm/3zWff/APLL/rmKKK6lsee9iun3TQPun60UVSIBv4aQ9vrRRTAVulM7tRRQAqfc/CkHaiipkARdPzqPtRRUlLcm/gp8X3hRRQPqeneFf+PUfSt+f/VmiisXudS2M8/fP0pG6UUUDHR9TUc3UUUUAJJ9yug0f/j2WiimxFif77fSsVv+PoUUUimXG/1IqaH/AFRoooK6HK6//r/wrJtvur9aKKpGT3LJ6n60UUUCP//Z"
- imgBaseNoNMd5="c49d86602e9c73032d9afe011dd13209"
-
- from log import _clog
- import subprocess
- import os
- import time
- import shutil
- from tornado.web import Application, RequestHandler
- from tornado.ioloop import IOLoop
- from tornado.options import define, options, parse_command_line
- from tornado.httpserver import HTTPServer
- import os.path
- import urllib
- import json
- import datetime
- import hashlib
- import random
- import ctypes
- import base64
- import subprocess
- import requests
- import threading
- import time
- #import demjson
-
- g_rysjsc_call_back = None
- g_face_call_back = None
-
- from tornado.options import define, options
- os.environ['LD_LIBRARY_PATH']="/auth_server/bin/lvmi/"
- define("port", default=9999, help="run on the given port")
- define("rysjsc_url", default=r"/jczpt/v3/rysjsc", help="run on the given port")
- define("face_url", default=r"/jczpt/v3/face", help="run on the given port")
- define("sbzt_url", default=r"/jczpt/v3/sbzt", help="run on the given port")
- define("my_test_url", default=r"/test", help="test postqueset")
-
-
- print ("Hello dilusense!!!")
-
- #is_error == 0
- g_err_code={0:"ok",
- 1:"user is error"
- }
-
- class test(RequestHandler):
- def post(self):
- is_error = 0
- body_dic = None
- default_v = 'null'
-
- try:
- body_dic = json.loads(self.request.body)
- _clog.info("1-----------------------------------------------------------------------test")
-
- _clog.info(body_dic)
-
- _clog.info("2-----------------------------------------------------------------------test")
- #_clog.info(body_dic)
- except Exception as e:
- _clog.error(e)
-
- #身份证回调函数
- def rysjsc_hdl_callbak():
- try:
- ret_list = {}
- ret_list2 = {}
- ret_list["ver"] = "3.0"
- ret_list["tranType"] = "10101"
- ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
- ret_list["sendTime"] = "2020-10-15 10:49:44"
- ret_list2["equipmentId"] = "653101010222200001"
- ret_list2["message"] = "0|请开闸放行"
- ret_list["data"] = ret_list2
-
- ret = json.dumps(ret_list)
- _clog.info("idcard ret is %s" % (ret))
- _clog.info("idcard g_rysjsc_call_back is %s" % (g_rysjsc_call_back))
-
- headers = {
- 'Connection': 'close'
- }
- r = requests.post(g_rysjsc_call_back, json=ret, headers=headers)
-
- #s = requests.session()
- #s.keep_alive = False
- #r = s.post(g_rysjsc_call_back, json=ret)
-
- _clog.info("idcar r.text is %s" % (r.text))
- except Exception as e:
- _clog.error(e)
-
- #身份证处理函数
- class rysjsc_hdl(RequestHandler):
- def post(self):
- is_error = 0
- body_dic = None
- default_v = 'null'
-
- try:
- body_dic = json.loads(self.request.body)
- global g_rysjsc_call_back
- g_rysjsc_call_back = body_dic["backUrl"]
- #_clog.info(body_dic)
- except Exception as e:
- _clog.error(e)
-
- ret_list = {}
- ret_list["ver"] = "3.0"
- ret_list["tranType"] = "10092"
- ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
- ret_list["sendTime"] = "2020-10-15 10:49:42"
- ret_list["tranResult"] = "200"
- ret_list["tranMsg"] = "tranMsg"
-
- ret = json.dumps(ret_list)
- #ret = demjson.decode(ret)
- self.write(ret)
- #rysjsc_hdl_callbak()
- t = threading.Thread(target=rysjsc_hdl_callbak)
- t.start()
-
-
- #人脸回调函数
- def face_hdl_callbak():
- try:
- ret_list = {}
- ret_list["ver"] = "3.0"
- ret_list["tranType"] = "10191"
- ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
- ret_list["sendTime"] = "2020-10-15 10:49:44"
-
- ret_list2 = {}
- ret_list2["equipmentId"] = "653101010222200001"
- ret_list2["message"] = "0|请开闸放行"
-
- ret_list3 = {}
- ret_list3["cardType"] = "653101010222200001"
- ret_list3["name"] = "张三"
- ret_list3["sex"] = "1"
- ret_list3["idcardImg"] = imgBaseNoN
- ret_list3["hash"] = imgBaseNoNMd5
-
- ret_list2["person"] = ret_list3
- ret_list["data"] = ret_list2
-
- ret = json.dumps(ret_list)
-
- _clog.info("face ret is %s" % (ret))
- _clog.info("g_face_call_back is %s" % (g_face_call_back))
-
- headers = {
- 'Connection': 'close'
- }
- r = requests.post(g_face_call_back, json=ret, headers=headers)
-
- #s = requests.session()
- #s.keep_alive = False
- #r = s.post(g_face_call_back, json=ret)
-
- _clog.info("face r.text is %s" % (r.text))
- except Exception as e:
- _clog.error(e)
-
- #人脸处理函数
- class face_hdl(RequestHandler):
- def post(self):
- is_error = 0
- body_dic = None
- default_v = 'null'
-
- try:
- body_dic = json.loads(self.request.body)
-
- global g_face_call_back
- g_face_call_back = body_dic["backUrl"]
- print ("backUrl %s " % (body_dic["backUrl"]))
-
- _clog.info("-----------------------------------------------------------------------")
- _clog.info(body_dic)
- except Exception as e:
- _clog.error(e)
-
- ret_list = {}
- ret_list["ver"] = "3.0"
- ret_list["tranType"] = "10092"
- ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
- ret_list["sendTime"] = "2020-10-15 10:49:42"
- ret_list["tranResult"] = "200"
- ret_list["tranMsg"] = "tranMsg"
-
- ret = json.dumps(ret_list)
- self.write(ret)
- #ret = demjson.decode(ret)
- t = threading.Thread(target=face_hdl_callbak)
- t.start()
-
- #设备状态
- class sbzt_hdl(RequestHandler):
- def post(self):
- is_error = 0
- body_dic = None
- default_v = 'null'
-
- try:
- body_dic = json.loads(self.request.body)
-
- _clog.info("-----------------------------------------------------------------------++++++++++++++++")
- _clog.info(body_dic)
- except Exception as e:
- _clog.error(e)
-
- ret_list = {}
- ret_list["ver"] = "3.0"
- ret_list["tranType"] = "10092"
- ret_list["tranNO"] = "000192ff-bcb7-4b1d-aa5e-f4b37feafda8"
- ret_list["sendTime"] = "2020-10-15 10:49:42"
- ret_list["tranResult"] = "200"
- ret_list["tranMsg"] = "tranMsg"
-
- ret = json.dumps(ret_list)
- #ret = demjson.decode(ret)
- self.write(ret)
-
- class web_svr:
- def __init__(self):
- pass
- def start_auth_server(self):
- try:
- options.parse_command_line()
- #app = Application(handlers=[(options.auth_url, web_hdl), (options.auth_soft_url, web_soft_hdl)])
- app = Application(handlers=[(options.rysjsc_url, rysjsc_hdl), (options.face_url, face_hdl), (options.sbzt_url, sbzt_hdl), (options.my_test_url, test)])
- http_server = HTTPServer(app)
- http_server.listen(options.port)
- #http_server.bind(options.port)
- #http_server.start(2)
- IOLoop.instance().start()
- except Exception as e:
- _clog.error(e)
- def t_q():
- url = "http://10.0.1.192:8383/callback"
- r = requests.post(url, json="{'a':'1'}")
- print (r.text)
-
- if __name__ == "__main__":
- svr = web_svr()
- svr.start_auth_server()
-
flask服务
- #!/user/bin/env python
- # coding=utf-8
- """
- @project : TestDemo
- @author : huyi
- @file : app.py
- @ide : PyCharm
- @time : 2021-10-15 11:58:44
- """
- from flask import Flask, request
- from gevent.pywsgi import WSGIServer
- from gevent import monkey
- import json
- import zmq, sys
-
- g_2_or_3 = 3
-
- # 将python标准的io方法,都替换成gevent中的同名方法,遇到io阻塞gevent自动进行协程切换
- monkey.patch_all()
-
- app = Flask(__name__)
-
- # face
- @app.route('/callback', methods=['POST'])
- def progress():
- try:
- request_data = json.loads(request.data)
- print("结果回调:{}".format(request_data))
-
- context = zmq.Context()
- socket = context.socket(zmq.REQ) # 设置socket类型,请求端
- socket.connect("tcp://10.0.1.192:6003") # 连接服务端的IP和端口
-
- socket.send_string(request_data) # 向服务端发送消息
- message = socket.recv() # 接收服务端返回的消息,注:是byte类型
- print("face recv info: " )
-
- zmqrecv_data = json.loads(message)
- print( zmqrecv_data)
- socket.close()
- return zmqrecv_data
- except Exception as e:
- print("face is error: " + e)
-
- # idcard
- @app.route('/callback/person', methods=['POST'])
- def result():
- try:
- request_data = json.loads(request.data)
- print("结果回调:{}".format(request_data))
-
- context = zmq.Context()
- socket = context.socket(zmq.REQ) # 设置socket类型,请求端
- socket.connect("tcp://10.0.1.192:6002") # 连接服务端的IP和端口
-
- socket.send_string(request_data) # 向服务端发送消息
- message = socket.recv() # 接收服务端返回的消息,注:是byte类型
- print("idcar recv info: " )
-
- zmqrecv_data = json.loads(message)
- print( zmqrecv_data)
- socket.close()
- return zmqrecv_data
- except Exception as e:
- print("idcard is error: " + e)
-
-
- if __name__ == '__main__':
- print("start.")
- WSGIServer(('0.0.0.0', 9001), app).serve_forever()
flask内zmq改进超时版本
- #!/user/bin/env python
- # coding=utf-8
- """
- @project :
- @author :
- @file :
- @ide :
- @time :
- """
- from flask import Flask, request
- from gevent.pywsgi import WSGIServer
- from gevent import monkey
- import json
- import zmq, sys
- from log import _clog
-
- g_2_or_3 = 3
-
- # 将python标准的io方法,都替换成gevent中的同名方法,遇到io阻塞gevent自动进行协程切换
- monkey.patch_all()
-
- app = Flask(__name__)
- # face
- @app.route('/callback', methods=['POST'])
- def progress():
- try:
- request_data = json.loads(request.data)
- _clog.info("face 结果回调:{}".format(request_data))
-
- _clog.info("face zmq.Context ...")
- context = zmq.Context()
-
- _clog.info("face context.socket ...")
- socket = context.socket(zmq.REQ) # 设置socket类型,请求端
-
- _clog.info("face socket.connect ...")
- socket.connect("tcp://127.0.0.1:6003") # 连接服务端的IP和端口
-
- _clog.info("face socket.setsockopt ...")
- socket.setsockopt(zmq.LINGER, 0)
-
- _clog.info("face zmq.Poller ...")
- poll = zmq.Poller()
-
- _clog.info("face poll.register ...")
- poll.register(socket, zmq.POLLIN)
-
- _clog.info("face socket.send_string ...")
- socket.send_string(request_data) # 向服务端发送消息
-
- socks = dict(poll.poll(3000))
- if socks.get(socket) == zmq.POLLIN:
- message = socket.recv() # 接收服务端返回的消息,注:是byte类型
- zmqrecv_data = json.loads(message)
- _clog.info("face recv info: ")
- _clog.info(zmqrecv_data)
- ret_info = json.dumps(zmqrecv_data)
- return ret_info
- poll.unregister(socket)
-
- socket.close()
- context.destroy()
-
- except Exception as e:
- _clog.error("face is error: ")
- _clog.error(e)
-
- # idcard
- @app.route('/callback/person', methods=['POST'])
- def result():
- try:
- request_data = json.loads(request.data)
- _clog.info("idcard 结果回调:{}".format(request_data))
-
- _clog.info("idcard zmq.Context ...")
- context = zmq.Context()
-
- _clog.info("idcard context.socket ...")
- socket = context.socket(zmq.REQ) # 设置socket类型,请求端
-
- _clog.info("idcard socket.connect ...")
- socket.connect("tcp://127.0.0.1:6002") # 连接服务端的IP和端口
-
- _clog.info("idcard socket.setsockopt ...")
- socket.setsockopt(zmq.LINGER, 0)
-
- _clog.info("idcard zmq.Poller ...")
- poll = zmq.Poller()
-
- _clog.info("idcard poll.register ...")
- poll.register(socket, zmq.POLLIN)
-
- _clog.info("idcard socket.send_string ...")
- socket.send_string(request_data) # 向服务端发送消息
-
- socks = dict(poll.poll(3000))
- if socks.get(socket) == zmq.POLLIN:
- message = socket.recv() # 接收服务端返回的消息,注:是byte类型
- zmqrecv_data = json.loads(message)
- _clog.info("idcard recv info: ")
- _clog.info(zmqrecv_data)
- ret_info = json.dumps(zmqrecv_data)
- return ret_info
- poll.unregister(socket)
-
- socket.close()
- context.destroy()
- except Exception as e:
- _clog.error("idcard is error: ")
- _clog.error(e)
-
- if __name__ == '__main__':
- print("start.")
- WSGIServer(('0.0.0.0', 9001), app).serve_forever()
c++ zmq req/rep模式
- void *ctx = NULL;
- void *s = NULL;
-
- bool
- CWorkThread::WaitCallbakForFace()
- {
- LOG(INFO) << " >>---->>> " << __FUNCTION__ << " begin. ";
-
- static bool init_net = false;
-
- if (!init_net) {
-
- zmq_close(s);
- zmq_term(ctx);
-
- ctx = zmq_init(1); // 创建上下文, 初始化一个io_thread
- if (!ctx) {
- LOG(INFO) << ">>---->>>" << "error in zmq_init:" << zmq_strerror (errno);
- return false;
- }
-
- s = zmq_socket(ctx, ZMQ_REP); // 创建REP类型的socket
- if (!s) {
- LOG(INFO) << ">>---->>>" << "error in zmq_socket:" << zmq_strerror (errno);
- zmq_term(ctx);
- return false;
- }
-
- LOG(INFO) << " >>---->>> ";
- int rc =zmq_bind(s, "tcp://*:6003"); // 绑定到端口并且在io_thread中accept连接
- if (rc != 0) {
- LOG(INFO) << ">>---->>>" << "error in zmq_socket:" << zmq_strerror (errno);
- zmq_close(s);
- zmq_term(ctx);
- return false;
- }
-
- const int nRequestTime = m_iRequestTimeout * 1000; //1s
- int zmqRes = zmq_setsockopt(s, ZMQ_SNDTIMEO, &nRequestTime, sizeof(nRequestTime));
- zmqRes = zmq_setsockopt(s, ZMQ_RCVTIMEO, &nRequestTime, sizeof(nRequestTime));
- LOG(INFO) << " >>---->>> " << __FUNCTION__ << ", m_iRequestTimeout is " << m_iRequestTimeout<< ", nRequestTime is " << nRequestTime;
-
- init_net = false;
- }
-
- #if 0 //demo
- LOG(INFO) << " >>---->>> " << __FUNCTION__ ;
- CThreadPool* p = CThreadPool::GetInstance();
- p->AddTaskToPool(boost::bind(&CWorkThread::ZmqReq, this));
- #endif
-
-
- if(m_currentWorkModel == WORK_MODEL_RECGNITOIN_AND_COLLECT_3D2D) {
- if(HAVE_ABORT == GetFaceAndIDCardState(FACE_CODE, false) || 1 == m_iIDCardExitFlag){
- LOG(INFO) << ">>---->>>" << "I(face) will exist:";
- return true; //整个流程视为成功
- }
- }
-
- // Wait for next request from client
- const int len = 1024000;
- char* recvContent = new char[len]; // 创建消息结构
- memset(recvContent, 0, len);
- int r = zmq_recv(s, (void*)recvContent, len, 0); // 从管道中接收消息
- if (r <= 0) {
- LOG(INFO) << " >>---->>> " << __FUNCTION__ << " zmq_recv error, failed. " << zmq_strerror(errno) << ",errno is " << errno
- << ",EAGAIN is " << EAGAIN << ",ENOTSUP is " << ENOTSUP<< ",EINTR is " << EINTR<< ",ENOTSOCK is " << ENOTSOCK
- << ",ETERM is " << ETERM<< ",EFSM is " << EFSM<< ",ENOTSUP is " << ENOTSUP;
- delete []recvContent;
- init_net = false;
- return false;
- }
- NotifyIDCardThreadToExit();
-
- LOG(INFO) << " >>---->>> " << __FUNCTION__ << ", recvCt: " << recvContent;
-
- Json::Value Jret;
- Json::Reader reader(Json::Features::strictMode());
-
- if(!reader.parse(recvContent, Jret)) {
- LOG(ERROR) << " >>---->>> " << "Initialize Json::Reader from WaitCallbakForIdcard error, failed";
- delete []recvContent;
- return false;
- }
-
- Json::Value v = Jret["data"];
-
- LOG(ERROR) << " >>---->>> " << "v[message]: " << v["message"].asString().c_str();
-
- char isPass[2] = {0,0};
- memcpy(isPass, v["message"].asString().c_str(), 1);
-
- if(atoi(isPass) != 0) {
- LOG(ERROR) << " >>---->>> "<< "Getting CODE info from 3DFace 1vN search return value, failed";
- m_iWarningType |= BLACKLISTPERSON_REQ;
- //return false;
- }
- LOG(ERROR) << " >>---->>> " << "isPass: " << isPass;
-
- m_isGetSearchResult = ParseLhcz2D1vNSearchResult(Jret);
-
- Json::Value rootJson;
- rootJson["ver"] = "3.0";
- rootJson["tranType"] = "10101";
- rootJson["tranNO"] = getRandomNum(36);
- rootJson["sendTime"] = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss").toStdString();
- rootJson["tranResult"] = "200";
- rootJson["tranMsg"] = "";
- string repContent = rootJson.toStyledString().c_str();
-
- LOG(INFO) << " >>---->>> " << "repContent is " << repContent;;
-
- int sc = zmq_send(s, (void*)repContent.c_str(), repContent.length(), 0); // 发送消息到管道,等待io_thread从管道中读取后发送
- if (sc <= 0) {
- LOG(WARNING) << " >>---->>> " << __FUNCTION__ << " zmq_send error, failed. " << zmq_strerror(errno);
- delete []recvContent;
- init_net = true;
- return true;
- }
-
- LOG(INFO) << " >>---->>> ";;
-
- // We never get here but if we did, this would be how we end
- delete []recvContent;
-
- LOG(INFO) << " >>---->>> " << __FUNCTION__ << " end. ";
-
- return true;
- }
log.py
- # -*- coding: UTF-8 -*-
- import logging
- from logging.handlers import TimedRotatingFileHandler
- from logging.handlers import RotatingFileHandler
- import re
- import time
- import os
- from tornado.options import define, options, parse_command_line
-
- define("log_path", default="./log/", help="./")
-
-
-
-
- def log_init():
- try:
- log_path = options.log_path
- try:
- if not os.path.exists(log_path):
- os.makedirs(log_path)
- except Exception as e:
- logging.error(e)
-
- logging.basicConfig(level=logging.DEBUG, format="%(asctime)s|%(levelname)s|%(filename)s:%(lineno)d|%(message)s", datefmt='%Y-%m-%d %H:%M:%S')
- log_fmt = '%(asctime)s\t %(filename)s:%(lineno)s %(levelname)s> %(message)s'
- formatter = logging.Formatter(log_fmt)
- log_file_handler = TimedRotatingFileHandler(filename=log_path +"trace.log", when="D", interval=1, backupCount=2)
- log_file_handler.suffix = "%Y-%m-%d_%H-%M"
- log_file_handler.extMatch = re.compile(r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}$")
- log_file_handler.setFormatter(formatter)
- log = logging.getLogger()
- log.addHandler(log_file_handler)
-
- return log;
-
- #removeHandler 要放在程序运用打印日志的后面
- #log.removeHandler(log_file_handler)()
- except Exception as e:
- logging.error(e)
-
- _clog = log_init()
-
-
- if __name__ == '__main__':
- print ("begin.")
- while 1:
- _clog.debug("debug")
- _clog.info("info")
- _clog.warning("warning")
- _clog.error("error")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。