
Python
learning Python
血_影
关注:计算机视觉、图形图像处理、机器学习、人工智能等领域.
喜欢:C/C++/python
邮箱:1013279512@qq.com
展开
-
实用笔记09
redis RedisHelper.py import redis class RedisHelper(object): def __init__(self): self.__conn = redis.Redis(host='localhost',port=6379)#连接Redis self.sub_channel = 'deep_engine_receive' #定义名称 self.pub_channel = "deep_engine_send"原创 2021-04-19 09:51:42 · 100 阅读 · 0 评论 -
实用笔记系列07
python 日志模块 # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os,sys import logging from logging.handlers import TimedRotatin原创 2021-04-14 14:44:05 · 134 阅读 · 2 评论 -
实用笔记系列4
defines a function for chunking data for multiprocessing # function that splits a list into n chunks for multiprocessing def chunk(file_list, n_chunks): # make chunks of files to be distributed across processes chunks = [] chunk_size = mat原创 2020-05-13 11:59:43 · 218 阅读 · 0 评论 -
实用笔记系列2
获取图片Exif旋转信息并旋转图片import cv2 from PIL import Image, ExifTags def img_ratation(image, angle): # grab the dimensions of the image and then determine the # center (h, w) = image.shape[:2] ...原创 2020-03-04 19:38:16 · 165 阅读 · 0 评论 -
Python3 错误和异常
Python 有两种错误很容易辨认:语法错误和异常。 Python assert(断言)用于判断一个表达式,在表达式条件为 false 的时候触发异常。 异常处理 try/except 异常捕捉可以使用 try/except 语句 try 语句按照如下方式工作: 首先,执行 try 子句(在关键字 try 和关键字 except 之间的语句) 如果没有异常发生,忽略 except 子句,t...原创 2020-02-05 14:35:19 · 453 阅读 · 0 评论