上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 55 下一页

2018年3月29日

python 高阶函数 map lambda filter等

摘要: map 描述 map() 会根据提供的函数对指定序列做映射。 第一个参数 function 以参数序列中的每一个元素调用 function 函数,返回包含每次 function 函数返回值的新列表。 map计算两个列表各个元素的平方 提供两个列表对相同位置的元素相加 阅读全文

posted @ 2018-03-29 14:31 星河赵 阅读(150) 评论(0) 推荐(0) 编辑

python 类的使用实例方法

摘要: class A: dict_1 = 456 def __init__(self): self.dict_1 = 'abcdsafdsf' #当增加@staticmethod 时为类方法 @staticmethod def edf(): print '\nstatic method edf' #为实例方法 a = ... 阅读全文

posted @ 2018-03-29 11:28 星河赵 阅读(215) 评论(0) 推荐(0) 编辑

2018年3月26日

python读取excel,数字都是浮点型,日期格式是数字的解决办法

摘要: #!/usr/bin/env python # -*- encoding: utf-8 -*- import xlrd import sys reload(sys) sys.setdefaultencoding('utf-8') import traceback from datetime import datetime from xlrd import xldate_as_tuple from... 阅读全文

posted @ 2018-03-26 16:19 星河赵 阅读(448) 评论(0) 推荐(0) 编辑

2018年3月23日

Python获取时间范围内日期列表和周列表的函数

摘要: 1、获取日期列表 输出结果 阅读全文

posted @ 2018-03-23 17:58 星河赵 阅读(7809) 评论(1) 推荐(0) 编辑

python 集合比较(交集、并集,差集)集合方法大全

摘要: python的set和其他语言类似, 是一个无序不重复元素集, 基本功能包括关系测试和消除重复元素. 集合对象还支持union(联合), intersection(交), difference(差)和sysmmetric difference(对称差集)等数学运算. sets 支持 x in set 阅读全文

posted @ 2018-03-23 17:03 星河赵 阅读(28942) 评论(0) 推荐(0) 编辑

2018年3月18日

axel命令 文件下载

摘要: axel是Linux下一个不错的HTTP/ftp高速下载工具。支持多线程下载、断点续传,且可以从多个地址或者从一个地址的多个连接来下载同一个文件。适合网速不给力时多线程下载提高下载速度。比如在国内VPS或服务器上下载lnmp一键安装包用Axel就比wget快。 CentOS安装Axel: 目前yum 阅读全文

posted @ 2018-03-18 19:29 星河赵 阅读(401) 评论(0) 推荐(0) 编辑

python 列表的内容赋值

摘要: l1 = '20180201 b4b8e187-d59d-33fb-addc-ef189aca3712 com.ss.android.article.news' l2 = re.split('[ ]+',l1) birthday,real_device_id,packname = l2 In [31]: birthday Out[31]: '20180201' In [32]: rea... 阅读全文

posted @ 2018-03-18 17:54 星河赵 阅读(2768) 评论(0) 推荐(0) 编辑

Python的sys.argv使用说明 通过终端写入环境变量

摘要: 刚开始使用这个参数的时候,很不明白其含义.网上搜索很多都是贴的官网上面的一则实例,说看懂,就明白.可是,我看不懂.现在在回头看这个参数使用,并不是很麻烦. 举几个小例子就明白了. 创建一个脚本,内容如下 终端运行 阅读全文

posted @ 2018-03-18 14:21 星河赵 阅读(259) 评论(0) 推荐(0) 编辑

python map函数的使用

摘要: python2 中的map函数返回列表 python3 中的map函数返回迭代器 如果函数有多个参数, 但每个参数的序列元素数量不一样, 会根据最少元素的序列进行: 阅读全文

posted @ 2018-03-18 13:06 星河赵 阅读(749) 评论(0) 推荐(0) 编辑

python 将txt内容写入excel

摘要: #!/usr/bin/env python # -*- coding: utf-8 -* import os import xlrd import xlwt import datetime import re from utils.XUtils import XUtils def create_and_write_data_to_excel(p_file_name_prefix=None,... 阅读全文

posted @ 2018-03-18 12:47 星河赵 阅读(2425) 评论(0) 推荐(0) 编辑

上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 55 下一页

导航