python
Fresh_Air_Life
出门在外,少说慎言。多运动,多读书
展开
-
在Linux中使用Python模拟键盘按键
之前在做自动化测试中需要用Python在linux中模拟Ctrl+V 进行路径粘贴,试了很多种方法,起初用了xerox和pyperclip这两个python库,但打开对话框后调用粘贴API无法进行粘贴,不知道为什么。然后发现了virtkey这个库,这个库可以在linux 中模拟键盘按键,但网上资料甚少。这个库主要有两个API1、press_keysym/release_keysym转载 2016-04-13 08:57:32 · 1120 阅读 · 0 评论 -
cookielib和urllib2模块相结合模拟网站登录
1.cookielib模块cookielib模块的主要作用是提供可存储cookie的对象,以便于与urllib2模块配合使用来访问Internet资源。例如可以利用本模块的CookieJar类的对象来捕获cookie并在后续连接请求时重新发送。coiokielib模块用到的对象主要有下面几个:CookieJar、FileCookieJar、MozillaCookieJar、LWPCooki转载 2016-04-18 09:32:29 · 414 阅读 · 0 评论 -
Python 的一些常用方法
一.strip()描述 Python strip() 方法用于移除字符串头尾指定的字符(默认为空格)。语法 strip()方法语法:str.strip([chars]);参数 chars -- 移除字符串头尾指定的字符。返回值 返回移除字符串头尾指定的字符生成的新字符串。实例 以下实例展示了strip()函数的使原创 2016-04-13 08:56:03 · 418 阅读 · 0 评论 -
Ubuntu 下面的切换 python 版本操作
archermind@archermind:~$ sudo update-alternatives --config python[sudo] password for archermind: There are 2 choices for the alternative python (providing /usr/bin/python). Selection Path ...原创 2019-07-16 14:03:15 · 151 阅读 · 0 评论