随笔分类 - Python Programming
From COMP9021, UNSW
摘要:```python import time from py2neo import Graph from config.neo4j_config import NEO4J_CONFIG_PRO # NEO4J_CONFIG_PRO = { # "host": "x.x.x.x", # "port":
阅读全文
摘要:```python # -*-coding:utf-8 -*- import redis from config.redis_config import CACHE_REDIS_CONF # CACHE_REDIS_CONF = { # "host": "x.x.x.x", # "port": ??
阅读全文
摘要:```python class MySqlClient: def __init__(self, db_name: str): self._conn = pymysql.connect(host=MYSQL_CONFIG['host'], port=MYSQL_CONFIG['port'], user
阅读全文
摘要:``` # requirement.txt happybase==1.2.0 ``` ```python """ hbase.py """ # -*- coding: utf-8 -*- import happybase from config.hbase_config import HAPPYBA
阅读全文
摘要:```python # -*- coding: utf-8 -*- import os import sys import shutil from time import perf_counter from collections import defaultdict from datetime i
阅读全文
摘要:``` # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eg
阅读全文
摘要:定义BaseLogger:base_logger.py # -*- coding: utf-8 -*- import sys import logging import logging.handlers from typing import Union from cfg.common import
阅读全文
摘要:日志记录(Logging) More than : 每次用 terminal debug 时都要手动在各种可能出现 bug 的地方 print 相关信息来确认 bug 的位置; 每次完成 debug 后为了避免输出太多细节信息和代码整洁,又需要把几个关键位置的 print 注释掉甚至删掉; 当下次出
阅读全文
摘要:装饰器(Decorator) Python 的装饰器是任何可调用对象(callable object),用于修改函数(Function)或类(Class)。按照用途可分为: 函数装饰器 类装饰器 装饰器的接口定义可概括为: 1. 接收某个函数或类的引用作为参数; 2. 修改该函数或类并返回。 简单函
阅读全文
摘要:``` !/usr/bin/python3 coding: UTF 8 import requests import time import gzip import urllib import json import hashlib import base64 def audio_dictation
阅读全文