会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
星瑞的随笔
走过,路过,看过,见过,想过,梦过,做过,错过,得过,失过,笑过,哭过,最后还是重头来过。
首页
新随笔
联系
管理
上一页
1
···
18
19
20
21
22
23
24
25
下一页
2017年9月9日
python之enumerate函数:获取列表中每个元素的索引和值
摘要: 源码举例: 运行结果:
阅读全文
posted @ 2017-09-09 09:15 星瑞
阅读(18848)
评论(0)
推荐(1)
2017年8月22日
selenium之批量执行测试用例生成HTML结果文件
摘要: 使用HTMLTestRunner运行测试套件,自动生成html测试报告: 1 import unittest, HTMLTestRunner, sendmail_html 2 import time, os 3 4 case_dir = 'D:\\pywork\\pyworkspace\\yzwx_selenium\\batch_case\\test_cases' 5 t = tim...
阅读全文
posted @ 2017-08-22 19:10 星瑞
阅读(319)
评论(0)
推荐(0)
2017年8月13日
python之工作举例:通过复制NC文件来造数据
摘要: 1 # 通过对NC文件复制来造数据 2 import os, shutil 3 4 # 遍历的根目录 5 root_dir = "D:\\test_data\\DISASTER\\" 6 # 获取NC文件的时间 7 time_source = '20161228080000' 8 # 生成NC文件的时间 9 time_new = '201812280...
阅读全文
posted @ 2017-08-13 23:04 星瑞
阅读(2070)
评论(0)
推荐(0)
python之多线程举例
摘要: 1 # 多线程举例 2 from threading import Thread 3 from threading import current_thread 4 5 6 class messager(Thread): 7 def run(self): 8 for x in range(20): 9 print(curre...
阅读全文
posted @ 2017-08-13 22:41 星瑞
阅读(193)
评论(0)
推荐(0)
python之发送HTML内容的邮件
摘要: 1 # 发送html内容的邮件 2 import smtplib, time, os 3 from email.mime.text import MIMEText 4 from email.header import Header 5 6 7 def send_mail_html(file): 8 '''发送html内容邮件''' 9 # 发送邮箱 10...
阅读全文
posted @ 2017-08-13 22:39 星瑞
阅读(16344)
评论(0)
推荐(0)
2017年8月12日
python之打印日志logging
摘要: 1 import logging 2 3 4 # 简单打印日志举例 5 logging.basicConfig(level=logging.DEBUG) # 设置日志级别,WARN 6 logging.warning('Watch out!') # will print a message to the console 7 logging.info('I told yo...
阅读全文
posted @ 2017-08-12 23:03 星瑞
阅读(2984)
评论(0)
推荐(1)
python之查询指定目录下的最新文件(os模块)
摘要: 使用os模块查询指定目录下的最新文件 1 import os 2 3 # 输入目录路径,输出最新文件完整路径 4 def find_new_file(dir): 5 '''查找目录下最新的文件''' 6 file_lists = os.listdir(dir) 7 file_lists.sort(k
阅读全文
posted @ 2017-08-12 22:23 星瑞
阅读(11050)
评论(0)
推荐(1)
python之datetime类
摘要: 运行结果:
阅读全文
posted @ 2017-08-12 22:17 星瑞
阅读(369)
评论(0)
推荐(0)
python之Counter类:计算序列中出现次数最多的元素
摘要: Counter类:计算序列中出现次数最多的元素 运行结果:
阅读全文
posted @ 2017-08-12 21:31 星瑞
阅读(2826)
评论(0)
推荐(0)
python之文件系统操作(os模块)
摘要: 文件系统操作(os模块) 运行结果: 文件遍历: 遍历目录下所有文件包括子目录 os.walk功能:递归遍历目录下的文件和子目录,参数(需要遍历的目录,排序=ture为顺序) 返回三个值:当前目录、当前目录下的目录列表和当前目录下的文件列表 运行结果:
阅读全文
posted @ 2017-08-12 21:22 星瑞
阅读(862)
评论(0)
推荐(0)
matplotlib之随机漫步
摘要: 运行截图:
阅读全文
posted @ 2017-08-12 21:13 星瑞
阅读(289)
评论(0)
推荐(0)
2017年8月6日
matplotlib之直接保存图片
摘要: 自动保存图表:pyplot.savefig('D:\\pic.png'),替代了 pyplot.show()。 1 # 使用matplotlib.pyplot.scatter绘制散点 2 import matplotlib.pyplot as plt 3 from pylab import mpl 4 5 # 设置默认字体,解决中文显示乱码问题 6 mpl.rcParams['fo...
阅读全文
posted @ 2017-08-06 22:58 星瑞
阅读(1700)
评论(0)
推荐(0)
matplotlib之scatter自动绘制散点
摘要: 运行结果:
阅读全文
posted @ 2017-08-06 22:54 星瑞
阅读(617)
评论(0)
推荐(0)
matplotlib之scatter绘制散点
摘要: 运行结果:
阅读全文
posted @ 2017-08-06 22:46 星瑞
阅读(278)
评论(0)
推荐(0)
可视化数据matplotlib之安装与简单折线图
摘要: 运行结果:
阅读全文
posted @ 2017-08-06 22:34 星瑞
阅读(288)
评论(0)
推荐(0)
上一页
1
···
18
19
20
21
22
23
24
25
下一页
公告