会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
菜菜_包包
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
下一页
2019年11月7日
关于解包和未知参数的使用
摘要: # conding:utf8# *args 代表可以输入多个参数def test(*args): return args# *loc 解包,解元祖的包, list不能解包,list的值使用循环取值def main(loc): print(*loc)# **kwargs 代表输入多个键值对参数def
阅读全文
posted @ 2019-11-07 14:53 菜菜_包包
阅读(322)
评论(0)
推荐(0)
2019年11月6日
python接口自动化
摘要: 1、在base.py文件中写入 # conding:utf8import requestsimport jsonclass ApiDemo(object): def __init__(self): pass # 请求方式为get def api_get(self, url, params=None,
阅读全文
posted @ 2019-11-06 15:58 菜菜_包包
阅读(483)
评论(0)
推荐(0)
2019年7月5日
读取yaml中的内容
摘要: def read_yml(path): """ 读取yml文件中的数据 :param path: 文件yaml 的路径 :return: 返回读取yaml文件内的结果 """ try: file = os.path.isfile(path) #判断文件是否存在 if file: files = os
阅读全文
posted @ 2019-07-05 18:04 菜菜_包包
阅读(823)
评论(0)
推荐(0)
2019年6月5日
实例方法,类方法,静态方法
摘要: class Foo(): h = "hello world" def __init__(self, key, value): self.key = key self.value = value def foo_test(self): print("实例方法") print(self.h) print
阅读全文
posted @ 2019-06-05 11:47 菜菜_包包
阅读(269)
评论(0)
推荐(0)
2019年6月1日
爬虫
摘要: # -*- coding: utf-8 -*-# @Time : 2019/5/31 19:33# @Author : zejin# @File : pachong.pyfrom urllib import requestimport reclass Analysis(): url = 'https
阅读全文
posted @ 2019-06-01 14:48 菜菜_包包
阅读(200)
评论(0)
推荐(0)
2019年5月24日
unittest ,ddt数据驱动,读取文件中数据,多个参数时的处理
摘要: 1. test.yaml中的数据 这里的属性是list 2.创建用例 3,在yaml中创建数据,创建list数据,list中再创建dict数据,这样就可以读取dict中的多个参数的数据了
阅读全文
posted @ 2019-05-24 12:25 菜菜_包包
阅读(734)
评论(0)
推荐(0)
2019年5月8日
python 自动化时,生成log
摘要: import loggingimport timeimport os,sys# from setting import *class Log: # 日志路径, 这里我写的自己配置的路径 log = ('report_' + ('%s') % time.strftime("%Y-%m-%d", tim
阅读全文
posted @ 2019-05-08 14:29 菜菜_包包
阅读(938)
评论(0)
推荐(0)
2019年3月28日
Python闭包和装饰器
摘要: 如果在一个内部函数里,对在外部作用域(但不是在全局作用域)的变量进行引用,那么内部函数就被认为是闭包(closure) 1、def hello(): x=3 #x表示外部作用域,(外部变量) def world(): #内部函数块, 功能就是打印x print(x) #引用外部变量x, return
阅读全文
posted @ 2019-03-28 11:07 菜菜_包包
阅读(222)
评论(0)
推荐(0)
2019年3月5日
关于Python导入其他目录中的类
摘要: 在需要导入的某个类的目录中,添加一个__init__.py的文件,
阅读全文
posted @ 2019-03-05 14:32 菜菜_包包
阅读(5443)
评论(0)
推荐(0)
2019年2月26日
Python 自动化测试config配置文件ini 配置目录
摘要: import ConfigParserimport ospath = os.path.join(os.path.dirname(__file__), 'config.ini').replace('\\','/')print path# config = ConfigParser.ConfigPars
阅读全文
posted @ 2019-02-26 10:15 菜菜_包包
阅读(1904)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
下一页
公告