python
smart_potato_
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
rsa&md5
RSA公钥加密 pip3 install pycrypto import json import requests import base64 from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_v1_5 key = ‘xxxxx’ rsa_key = '-----BEGIN PUBLIC KEY---...原创 2019-11-12 14:17:15 · 324 阅读 · 0 评论 -
random
random.random() -------取浮点数x,0<=x<1 In [36]: random.random() Out[36]: 0.209811164981883 In [37]: random.random() Out[37]: 0.9981253745428653 In [38]: random.random() Out[38]: 0.3911322367559...原创 2018-01-16 15:34:36 · 223 阅读 · 0 评论 -
selenium
1、搭建环境 1)安装python3+selenium brew install python3 pip3 install selenium(安装最新版) 或pip3 install selenium==版本号(安装指定版本号) 没有特殊要求安装最新版即可 2)下载chrome浏览器和chromedriver chromedri...原创 2018-01-10 10:51:31 · 348 阅读 · 0 评论 -
unittest控制case执行顺序
1、名字改成test_a_xxx, test_b_xxx格式,会分别执行a, b, .... 2、 suite = unittest.TestSuite() suite.addTest(类名('函数名1')) suite.addTest(类名('函数名2')) ...... runner = unittest.TextTestRunner(...原创 2018-03-14 14:10:28 · 2278 阅读 · 0 评论 -
BeautifulSoup
from bs4 import BeautifulSoup import requests url = 'https://book.douban.com/subject/1770782/' response = requests.get(url).text soup = BeautifulSoup(response, 'html.parser') #获取div中class为intro的信息 ...原创 2018-01-30 15:15:36 · 203 阅读 · 0 评论 -
yaml和ini
yaml 冒号: ------>字典 横杠-------->列表 操作:open函数打开yaml文件,f.read读取,yaml.load格式化 例: yaml_file = './a.yaml' with open(yaml_file, 'r') as f: contents = f.read() re...原创 2018-01-30 11:14:26 · 554 阅读 · 0 评论 -
requests接口测试
get import requests import json url= 'https://m.douban.com/rexxar/api/v2/muzzy/columns/10008/items?start=0&count=3' response = requests.get(url) contents = json.loads(r...原创 2018-01-29 16:41:43 · 891 阅读 · 0 评论 -
mac安装virtualenv
1、安装 1)pip3 install virtualenv 2)pip3 install virtualenvwrapper virtualenvwrapper是virtualenv的拓展包 2、环境变量 1)vim ~/.bash_profile 2)输入 export VIRTUALENVWRAPPER_PYTH...原创 2018-01-29 16:40:41 · 258 阅读 · 0 评论 -
Python multiprocessing.Queue() 和 queue.Queue区别
Queue.Queue是进程内非阻塞队列。 multiprocess.Queue是跨进程通信队列。 多进程前者是各自私有,后者是各子进程共有。原创 2018-01-31 09:25:08 · 4452 阅读 · 0 评论 -
python基础
1、number, string, [], (), {} 2、if, for, while 3、class,def 4、正则 pattern = r'\d+(.*?)\d+', re.match(pattern, string) re.search(pattern, string) a = '123abc123' r...原创 2018-01-07 16:52:13 · 257 阅读 · 0 评论 -
appium+allure+pytest
1、环境搭建 brew install allure npm installappium pip3 install pytest pip3 install allure-pytest pip3 install pytest-allure-adaptor sudo pip3 install Appium-Python-Client ...原创 2018-01-22 14:22:32 · 653 阅读 · 0 评论
分享