This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import logging.config | |
def configure_logger(name, log_path): | |
logging.config.dictConfig({ | |
'version': 1, | |
'formatters': { | |
'default': {'format': '%(asctime)s - %(levelname)s - %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S'} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import logging.config | |
def configure_logger(name, log_path): | |
logging.config.dictConfig({ | |
'version': 1, | |
'formatters': { | |
'default': {'format': '%(asctime)s - %(levelname)s - %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S'} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from celery import Celery | |
app_add = Celery('app_add',backend='redis://localhost:6379/0',broker='redis://localhost:6379/0') | |
from kombu import Exchange, Queue | |
media_exchange = Exchange('app_reduce', type='direct') | |
app_add.conf.task_queues = ( | |
Queue('app_reduce', media_exchange, routing_key='app_reduce'), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 说明文档 | |
# https://docs.celeryproject.org/en/latest/userguide/routing.html#broadcast | |
from celery import Celery | |
app_add = Celery('app_add',backend='redis://localhost:6379/0',broker='redis://localhost:6379/0') | |
from kombu import Exchange, Queue | |
# default_exchange = Exchange('default', type='direct') | |
# media_exchange = Exchange('media', type='direct') | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 说明文档 | |
# https://blog.csdn.net/duxin_csdn/article/details/88966295 | |
# 库文件位置 | |
# https://github.com/kylebgorman/textgrid | |
# 解析代码 | |
import textgrid | |
def is_chinese(uchar): | |
"""判断一个unicode是否是汉字""" | |
if (uchar >= u'\u4e00') and (uchar<=u'\u9fa5'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 说明文档 | |
# https://blog.csdn.net/duxin_csdn/article/details/88966295 | |
# 库文件位置 | |
# https://github.com/kylebgorman/textgrid | |
# 解析代码 | |
import textgrid | |
def is_chinese(uchar): | |
"""判断一个unicode是否是汉字""" | |
if (uchar >= u'\u4e00') and (uchar<=u'\u9fa5'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 说明文档 | |
# https://blog.csdn.net/duxin_csdn/article/details/88966295 | |
# 库文件位置 | |
# https://github.com/kylebgorman/textgrid | |
# 解析代码 | |
import textgrid | |
def is_chinese(uchar): | |
"""判断一个unicode是否是汉字""" | |
if (uchar >= u'\u4e00') and (uchar<=u'\u9fa5'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 说明文档 | |
# https://blog.csdn.net/duxin_csdn/article/details/88966295 | |
# 库文件位置 | |
# https://github.com/kylebgorman/textgrid | |
# 解析代码 | |
import textgrid | |
def is_chinese(uchar): | |
"""判断一个unicode是否是汉字""" | |
if (uchar >= u'\u4e00') and (uchar<=u'\u9fa5'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
把一个类实例的生成写成类方法放入类里面, 你直接定义一个函数好不好, 叫获取类实例, 好么. | |
神烦!!! | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
如何实战一步步的增强自己的技术落地能力. | |
1 了解一门技术, 技术的适用场景及实现架构. | |
2 实战最简单实现. | |
3 实战通用实现. | |
4 实战特例实现. | |
5 实战工程化实现, 在具体项目中的嵌入和应用. | |
""" |
NewerOlder