摘要: import threading # 线程模块 def function(num): pass thread_1 = threading.Thread(target=function, args=(1,)) # 创建线程 thread_1.start() # 启动线程 thread_1.getNam 阅读全文
posted @ 2020-07-08 14:46 Echo丶Mikasa 阅读(352) 评论(0) 推荐(0)
摘要: 列表 # list.append():在末尾追加新的元素值 list1 = [1, 2, 3, 4] list1.append(5) print(list1) # list.extend():在末尾追加另一个列表 list2 = [1, 2, 3, 4] list2.extend([5, 6, 7] 阅读全文
posted @ 2020-07-08 11:24 Echo丶Mikasa 阅读(316) 评论(0) 推荐(0)
摘要: import time def get_now_time(): now_time = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())) return now_time 阅读全文
posted @ 2020-07-08 10:51 Echo丶Mikasa 阅读(797) 评论(0) 推荐(0)
摘要: def websocket_wss(): try: wss = create_connection(wss_url, timeout=10) if wss.status == 101: wss.send(data) print(ws.recv()) except BaseException as m 阅读全文
posted @ 2020-07-07 20:03 Echo丶Mikasa 阅读(2345) 评论(0) 推荐(0)
摘要: # coding=utf-8 import requests import time import uuid import hashlib import hmac import random import urllib3 import threading from config import rea 阅读全文
posted @ 2020-07-07 19:46 Echo丶Mikasa 阅读(430) 评论(0) 推荐(0)
摘要: # coding=utf-8 import time import base64 import sys import hashlib import hmac import struct def google_code(secret_key): key = base64.b32decode(secre 阅读全文
posted @ 2020-07-07 19:14 Echo丶Mikasa 阅读(827) 评论(0) 推荐(1)
摘要: 安装yaml pip install PyYAML 读取 def read_yaml(): path = 'yaml_ini_data.yaml' # print(path) file = open(path, 'rb') result = file.read() data = yaml.load( 阅读全文
posted @ 2020-07-07 19:07 Echo丶Mikasa 阅读(201) 评论(0) 推荐(0)
摘要: # 安装 pip install pymysql # 连接数据库 connect = pymysql.connect( host='ip', port=port, user='root', passwd='password', db='db_name', charset='utf8') # 创建游标 阅读全文
posted @ 2020-07-07 17:39 Echo丶Mikasa 阅读(137) 评论(0) 推荐(0)
摘要: 1、安装 pip install pyinstaller 2、检查 pyinstaller --version 3、参数说明 pyinstaller -w -F python.py -i img.ico -w 去掉控制台窗口 -F 表示生成单个可执行文件 -i 表示可执行文件的图标 阅读全文
posted @ 2020-07-07 17:38 Echo丶Mikasa 阅读(101) 评论(0) 推荐(0)
摘要: import logging logging.basicConfig(filename= 'out.log',filemode= 'w+', level= logging.DEBUG, format= '%(asctime)s - %(levelname)s - %(message)s') file 阅读全文
posted @ 2020-07-07 17:36 Echo丶Mikasa 阅读(181) 评论(0) 推荐(0)