Description The method strip() returns a copy of the string in which all chars have been stripped from the beginning and the end of the string (defaul ...
分类:
编程语言 时间:
2017-03-23 21:33:32
阅读次数:
194
1.where 方式2 方式3 where的第二个扩展方法包含集合的index索引 多个where从句 需要记住的几点: 1.Where根据特定条件来筛选集合元素 2.where扩展方法有2个重载,使用第二个重载方法可以知道当前元素在集合中的索引位置 3.方法语法需要整个lambda表达式,而查询语 ...
分类:
其他好文 时间:
2017-03-22 23:15:15
阅读次数:
149
#!/usr/bin/evnpythonimportredefdeal_negative_issue(calc_list):new_calc_list=[]#定义一个新的空列表,后面筛选完成后将数据放入新列表中forindex,iteminenumerate(calc_list):ifitem.strip().endswith("*")oritem.strip().endswith("/"):#挑选出以乘号或除号结尾的字符串ne..
分类:
编程语言 时间:
2017-03-21 20:38:32
阅读次数:
225
多的不说,上代码!!!#!/usr/bin/envpython#coding:utf-8importurllib,re,jsondefinput_content(url):#接收一个url(翻译AIP)whileTrue:content=raw_input(‘请输入翻译内容:‘)#用户输入的内容ifstr.strip(content)==‘‘:#如果用户输入的内容为空continue#进入下一轮循环elifco..
分类:
编程语言 时间:
2017-03-19 22:49:02
阅读次数:
221
本博文将带领你从入门到精通爬虫框架Scrapy,最终具备爬取任何网页的数据的能力。
分类:
编程语言 时间:
2017-03-19 22:35:25
阅读次数:
325
1、对文件操作流程 1、对文件操作流程 打开文件,得到文件句柄赋值给一个变量 通过文件句柄,对文件进行操作 关闭文件 格式: #获取文件句柄 f = open("yesterday","r",encoding="utf-8") #读取数据 data = f.read() #打印读取的文件 print ...
分类:
其他好文 时间:
2017-03-19 21:58:09
阅读次数:
154
一、Python中序列的分类 常见序列类型包括字符串(普通字符串和unicode字符串),列表和元组.所谓序列,即成员有序排列,可通过下标访问. 二、Python序列通用操作 下面我们将分别以字符串、列表和元组为例来说明对序列的操作 序列中的元素都是有序的、拥有自己编号(从0开始),我们可以通过索引 ...
分类:
编程语言 时间:
2017-03-19 02:54:29
阅读次数:
348
Jenkins+git+webhook自动触发部署和测试任务 需求: 目前上线前会将需要上线的代码push到release分支,然后由人工填写参数点击触发jenkins上的任务。希望这个过程能完成自动化,只要有人往release上推代码,就自动跑部署release分支并测试 解决办法及步骤: 1.在 ...
分类:
Web程序 时间:
2017-03-18 23:14:48
阅读次数:
1974
import time user,passwd='alex','abc123' def auth(auth_type): # print('auth_func:',auth_type) def outer_wrapper(func): def wrapper(*args, **kwargs): if... ...
分类:
编程语言 时间:
2017-03-17 23:24:27
阅读次数:
187
1 import string 2 path = 'waldnn' 3 with open(path,'r') as text: 4 words = [raw_word.strip(string.punctuation).lower() for raw_word in text.read().spl... ...
分类:
编程语言 时间:
2017-03-10 20:48:22
阅读次数:
202