1.mysql操作 1 import pymysql 2 from DBUtils.PooledDB import PooledDB 3 4 5 class SQLHandler(object): 6 def __init__(self, host, port, db_username, db_pa ...
分类:
数据库 时间:
2020-06-14 15:06:26
阅读次数:
88
定义仪表盘: def gauge_html(self, chart_id, title, val): gauge = Gauge( "{}-{}".format(self.dt, title), title_pos="center", width="100%", title_text_size=14 ...
分类:
其他好文 时间:
2020-06-14 10:51:47
阅读次数:
70
/etc/php-fpm.d/www.conf vim /root/ansible/nginx/www.conf ; Start a new pool named 'www'. [www] ; Unix user/group of processes ; Note: The user is mand ...
分类:
Web程序 时间:
2020-06-14 01:36:13
阅读次数:
86
1、知识点 类变量:类定义的时候,这个变量就定义好了 实例变量(成员变量)、实例方法(成员方法) 类方法: 用@classmethod修饰的方法 自带的方法,不用实例化就可以调用 是公共的方法,在实例方法里可随意调用 类方法里面不能调用实例方法、不能使用实例变量,可调用其他的类方法 属性方法:看起来 ...
分类:
编程语言 时间:
2020-06-13 23:19:35
阅读次数:
70
# from threading import Thread # import time # lqz = -1 # def task(arg): # global lqz # lqz = arg # time.sleep(2) # print(lqz) # # for i in range(10): ...
分类:
编程语言 时间:
2020-06-13 23:17:08
阅读次数:
80
1 class BTree: 2 def __init__(self, value): 3 self.left = None 4 self.data = value # 节点值 5 self.right = None 6 7 def insertLeft(self, value): # 左子树插入节 ...
分类:
其他好文 时间:
2020-06-13 21:13:18
阅读次数:
70
画面和字幕是后续做游戏我非常需要的,那么如何让画面暂停下来呢? 在最开始的设计中有一个show_start_screen用来显示开始的画面,这个画面里面的功能很简单: def show_start_screen(self): self.screen.fill(BLACK) self.draw_tex ...
分类:
其他好文 时间:
2020-06-13 19:46:04
阅读次数:
63
descption We have a sorted set of digits D, a non-empty subset of {'1','2','3','4','5','6','7','8','9'}. (Note that '0' is not included.) Now, we writ ...
分类:
其他好文 时间:
2020-06-13 17:10:49
阅读次数:
64
# Elasticsearch Configuration # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # Before you set out to tweak and tune the con ...
分类:
其他好文 时间:
2020-06-13 16:02:42
阅读次数:
62
一、基础 1、 定义节点类 # Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None 2、给定一张图 二、基础 ...
分类:
编程语言 时间:
2020-06-13 13:04:01
阅读次数:
55