03 2018 档案

Python_48re模块的sub方法
摘要:sub是替换的功能 sub(模型,替换为的字符,目标原字符串,替换次数) import re yuanchuan='1qaz2wsx3edc4rfv5tgb' new_str=re.sub('\d','INTNUM',yuanchuan,2) #若果没有2表示默认替换所有的 print (new_s 阅读全文

posted @ 2018-03-31 17:51 JuGooLar 阅读(243) 评论(0) 推荐(0)

Python_48split方法
摘要:分割 ['qwert', 'yugehello ', 'lext hey ok gou qqdfdffff']['qwert', 'yugehello ', 'lext hey ok gou qqdfdffff']['qwert', 'ugehello ', 'ext hey ok gou qqdf 阅读全文

posted @ 2018-03-30 17:17 JuGooLar 阅读(255) 评论(0) 推荐(0)

Python_47findall方法
摘要:1、应用范围 findall把匹配到的东西,都放到列表里边 <callable_iterator object at 0x0000000001DE1358><_sre.SRE_Match object; span=(8, 12), match='alex'><_sre.SRE_Match objec 阅读全文

posted @ 2018-03-29 17:40 JuGooLar 阅读(1445) 评论(0) 推荐(0)

Python_46search模块
摘要:1、匹配范围 search的匹配范围是全局,整个字符串 match的匹配范围是从开头,如果不是以某个字符或者字符串开头的则匹配不到任何结果 search和match这两个都是只匹配到一个就结束 阅读全文

posted @ 2018-03-29 15:53 JuGooLar 阅读(187) 评论(0) 推荐(0)

Pyhton_45正则表达式之match以及分组
摘要:一、正则 正则表达式就是re模块,要先引入 re 模块 re主要的功能: 二、 阅读全文

posted @ 2018-03-28 17:18 JuGooLar 阅读(191) 评论(0) 推荐(0)

Python_44pickle模块序列化与json模块
摘要:2、以用户信息被修改的例子 3、pickle下的方法 dump pickle.dump(account_dic,f_accw) dumps f_accw.write(pickle.dumps(account_dic)) load account_dic=pickle.load(f_account) 阅读全文

posted @ 2018-03-27 16:58 JuGooLar 阅读(135) 评论(0) 推荐(0)

Python_43sys模块练习
摘要:1、创建文件目录 2、创建进度条 阅读全文

posted @ 2018-03-27 14:51 JuGooLar 阅读(131) 评论(0) 推荐(0)

Python_41datetime模块
摘要:import time import datetime print (time.clock()) 返回处理器时间 print (time.time()) 返回当前系统时间戳 print (time.ctime()) 输出带有星期 日历 时间的当前系统时间 print (time.ctime(time 阅读全文

posted @ 2018-03-27 10:17 JuGooLar 阅读(104) 评论(0) 推荐(0)

Python_40Sys模块
摘要:sys.argv 命令行参数LIst,第一个元素是程序本身路径 sys.exit(n) 退出程序,正常退出exit(0) sys.version 获取Python解释程序的版本信息 sys.maxint 最大Int值 sys.path 返回模块的搜索路径,初始化时使用PYTHONPATH环境变量的值 阅读全文

posted @ 2018-03-13 20:47 JuGooLar 阅读(140) 评论(0) 推荐(0)

Python_39Time模块
摘要:模块的工能:工作模块化 Python有非常丰富的模块库; Python有自带的库200-300多个 Python常用的库 time & 模块:做时间转换的。 ———————————— 1520933656.788 时间戳 从1970年1月1日开始计时 到现在有多少秒了 time.ctime() Tu 阅读全文

posted @ 2018-03-13 17:54 JuGooLar 阅读(136) 评论(0) 推荐(0)

Python_38正则表达式计算器
摘要:正则表达式:'\a'是一个响铃符 BEL ‘\b’ 是退格特殊字符 阅读全文

posted @ 2018-03-13 17:04 JuGooLar 阅读(108) 评论(0) 推荐(0)

Python_37正则表达式
摘要:正则表达式:本身也是一门语言 字符串的方法: find 返回的是位置 ‘abdcdd’.find('b') 返回b的位置 split 分割字符串 replace 替换 正则表达式是给现有方法基础上添加功能 有一定规则的功能 正则表达式的功能: 字符匹配: 普通字符匹配配: re.findall('a 阅读全文

posted @ 2018-03-02 16:55 JuGooLar 阅读(189) 评论(0) 推荐(0)

导航