摘要:
1.操作excel xlrd 读 xlwt 写 xlutils 修改2.网络编程 urllib url编码 requests模块 r = requests.get(url, data={'x': y}, headers={'x': y}, cookies={'x': y}) r = requests 阅读全文
摘要:
class WslFather(object): @property def money(self): return 1000000000 def smoke(self): self.yan = '玉溪' print('抽烟') def drink(self): print('喝酒') def ta 阅读全文
摘要:
class Car(object): # 模型,模板 def __init__(self, color, window): # 构造函数,类在初始化的时候会执行它,顺序无所谓,可以写在最下面 # 如果你的类在实例化的时候要传入一些参数,那么你就要在__init__这个函数里写参数了 self.col 阅读全文
摘要:
import redisclass MyRedis(object): xiaohei = 'hahaha' def __init__(self, host, password='', port=6379): self.__host = host self.password = password se 阅读全文
摘要:
import requestscookies = 'dy_did=d94fe220c9ac1c014987ec5e00061501; _dys_refer_action_code=init_page_studio_v; acf_yb_auth=e5a8f675af47acaeaf434cad9406 阅读全文
摘要:
# import traceback# import pymysql# def calc(a, b):# res = (a / b)# return res### def main():# money = input('输入多少钱:')# months = input('还几个月:')# try:# 阅读全文
摘要:
# 签名 为了防止作弊# 1.用户设备号码MD5加密一次# 2.再取加密后的前10位# 3.再加盐,再给他md5一次# 4.生成一个字符串from hashlib import md5class GetSign(object): slat = 'WSL234_#$%_12' def __init__ 阅读全文
摘要:
class Person(object): country = 'China' # 类变量 def __init__(self, name, age, sex): self.name = name # 实例变量,必须实例化才能用,也叫成员变量 self.age = age self.sex = se 阅读全文
摘要:
import smtplib # 发邮件的from email.mime.text import MIMEText # 构造邮件内容的,对象username = '18033551998@163.com'password = 'jiqiren123'msg = MIMEText('你好,快过年了,新 阅读全文
摘要:
import urllib.parses = 'tiger自动化测试'print(urllib.parse.quote(s)) # url编码print(urllib.parse.quote_plus(s)) # url编码src = 'https://www.baidu.com/s?wd=best 阅读全文
摘要:
class My(object): def __init__(self, name, skill): self.name = name self.skill = skill self.cry() def cry(self): # 实例方法,必须实例化之后才可以调用 print('%s在哭。。。' % 阅读全文
摘要:
import pymysqlclass OpMySql1: # 经典类 passclass OpMySql(object): # 新式类 def __init__(self, host, user, password, db, port=3306, charset='utf8'): schema = 阅读全文