摘要: import redisclass MyRedis: def __init__(self,host,password,port,db): self.host = host self.password = password self.port = port self.db = db self.__re 阅读全文
posted @ 2021-03-12 15:10 术成 阅读(165) 评论(0) 推荐(0)
摘要: import pymysqlclass mysqlUtil: def __init__(self,user,passwd,host,port,db): self.user = user self.passwd = passwd self.host = host self.port = port se 阅读全文
posted @ 2021-03-11 16:57 术成 阅读(310) 评论(0) 推荐(0)
摘要: 需求: 1、写一个函数,入参是qq群号码,然后把这个群里面所有人的头像,在当前目录创建一个qq群号码的文件夹,把头像下载到这个文件夹里面, 头像文件名以群备注为名称,现场-xxx.jpg,如果这个人没有群备注,那么使用昵称做名称 https://qun.qq.com/ https://q4.qlog 阅读全文
posted @ 2021-02-20 11:12 术成 阅读(1275) 评论(0) 推荐(0)
摘要: import timeimport hmacimport hashlibimport base64import urllib.parsedef get_sign(): timestamp = str(round(time.time() * 1000)) secret = 'SEC6b56772f91 阅读全文
posted @ 2021-02-02 19:48 术成 阅读(249) 评论(0) 推荐(0)
摘要: #z钉钉第一种,自定义关键字import requestsurl = "https://oapi.dingtalk.com/robot/send?access_token=1dc3bfa867e169261bb21793fff3da9f83f756085efadaa0bdd107c453e3e91c 阅读全文
posted @ 2021-02-02 19:30 术成 阅读(236) 评论(0) 推荐(0)
摘要: #select * from user where username="%s";' % username #登陆 import hashlibimport string, datetimeimport pymysql# 检查用户是否在数据库中def check_user_exist(username 阅读全文
posted @ 2021-01-29 12:02 术成 阅读(103) 评论(0) 推荐(0)
摘要: #select * from user where username="%s";' % username #注册 import hashlibimport stringimport pymysql# 检查表是否存在,不存在先建表def checktable_isexist(): cur.execut 阅读全文
posted @ 2021-01-29 12:01 术成 阅读(239) 评论(0) 推荐(0)
摘要: 写一个函数,传入表名和数据库名,然后把这个表里面所有的数据导出到excel里面def export_to_excel(table_name,db_name): import pymysqlimport xlwt,xlutilsmysql_info = { "host": "118.24.3.40", 阅读全文
posted @ 2021-01-27 19:52 术成 阅读(71) 评论(0) 推荐(0)
摘要: import datetime,osimport timetime_str = time.strftime('%Y-%m-%d') #时间字符串print(time_str)time_tuple = time.strptime(time_str,'%Y-%m-%d')print(time_tuple 阅读全文
posted @ 2021-01-22 19:15 术成 阅读(158) 评论(0) 推荐(0)
摘要: #!/usr/bin/python# -*- coding:utf-8 -*-import jsonimport xlrdimport xlwtfrom xlutils import copystr_json = '{"1":["小花",99,100,98.5],"2":["小王",90,30.5, 阅读全文
posted @ 2021-01-22 19:13 术成 阅读(205) 评论(0) 推荐(0)