随笔 - 265  文章 - 0 评论 - 5 阅读 - 17万
< 2025年4月 >
30 31 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 1 2 3
4 5 6 7 8 9 10

上一页 1 2 3 4 5 6 ··· 18 下一页
摘要: import structimport base64import itertoolsimport chardetfrom collections import namedtuple,defaultdict,OrderedDict,Counter # namedtuple 新建1个元组,并设置元素的属 阅读全文
posted @ 2018-12-08 22:37 新美好时代 阅读(162) 评论(0) 推荐(0) 编辑
摘要: #生成re对象 compile# 之后再期调用 match search 返回匹配到的字符串# findall 返回匹配结果的列表#如果要对匹配的结果进行分组,可加(),并可通过\数字 去应用 阅读全文
posted @ 2018-12-08 20:37 新美好时代 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:utf-8 -*-import time#方式1class People: def __init__(self, name, age): self.__name = name self.__age = age def get_age 阅读全文
posted @ 2018-12-07 21:29 新美好时代 阅读(145) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:utf-8 -*-str="test"print(ascii(str))a=bytearray("asdff",encoding='utf-8')print(a)b=bytearray(10)print(b)c=bytearray( 阅读全文
posted @ 2018-12-07 21:24 新美好时代 阅读(169) 评论(0) 推荐(0) 编辑
摘要: #subprocess 创建子进程 连接输入 输出 管道错误,及获取他们的状态,可执行操作系统级的命令# subprocess.run(args, *, stdin=None, input=None, stdout=None, stderr=None, shell=False,# cwd=None, 阅读全文
posted @ 2018-12-07 21:15 新美好时代 阅读(159) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:utf-8 -*-import osimport randomimport stringla=[0,1,2,3,4,5,6,7,8,9]print(random.seed(10))print(random.getrandbits(3 阅读全文
posted @ 2018-12-07 21:12 新美好时代 阅读(148) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:utf-8 -*-import timefrom datetime import datetime,timedelta,timezone#UTC 世界协调时间 格林威治天文时间 世界标准时间#DST 夏令时#时间戳->结构化时间 U 阅读全文
posted @ 2018-12-07 21:09 新美好时代 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:utf-8 -*- import sysimport timedef bar(num, total): rate = num / total rate_num = int(rate * 100) r = '\r[%s%s]%d%%' 阅读全文
posted @ 2018-12-07 12:25 新美好时代 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-12-06 20:27 新美好时代 阅读(300) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:utf-8 -*-# 换行\n 续行\ s[:i] + s[i:] 等于 s#转义 \e 空 \000 八进制 \oyy 十六进制 \xyy# 颜色控制 \033 格式:\033[显示方式;前景色;背景色;m正文 使用终端默认颜色: 阅读全文
posted @ 2018-12-06 20:05 新美好时代 阅读(197) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:utf-8 -*- import requestsimport jsonimport reimport urllib3from urllib.parse import urlencode,quote,unquoteurl="http 阅读全文
posted @ 2018-12-05 12:44 新美好时代 阅读(222) 评论(0) 推荐(0) 编辑
摘要: #read1.html文件# <html><head><title>The Dormouse's story</title></head># <body># <p class="title"><b>The Dormouse's story</b></p>## <p class="story">Onc 阅读全文
posted @ 2018-12-05 12:27 新美好时代 阅读(2329) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:UTF-8 -*-import requestsfrom bs4 import BeautifulSoupres=requests.get("https://www.cnblogs.com/NiceTime/")# c=res.co 阅读全文
posted @ 2018-12-05 12:13 新美好时代 阅读(184) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:UTF-8 -*- import requestsfrom selenium import webdriverfrom bs4 import BeautifulSoupimport reimport timeclass GetFan 阅读全文
posted @ 2018-12-05 12:04 新美好时代 阅读(198) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding:UTF-8 -*-import logging, time, os# 这个是日志保存本地的路径log_path = "D:\\ideaSpace\\autoProject\\autotest\\nicetime"class Log: 阅读全文
posted @ 2018-12-05 11:58 新美好时代 阅读(163) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 18 下一页
点击右上角即可分享
微信分享提示