随笔分类 - python
python,django
摘要:原创内容转载请注明出处:www.cnblogs.com/zhangbo2012/ QQ:369029696 EMAIL:zhangbo2012@outlook.com本周用python实现了一个门户应用状态检查脚本。主要作用是快速收集应用状态,自动收集预置checkpoint的状态,在出现异常时提升问题定位效率。已实现以下功能:1、进程核查2、GC情况核查3、峰值秒PV核查4、TCP连接数核查5...
阅读全文
摘要:使用正则表达式,对QQ群聊天记录进行解析,用于分析日期、成员等维度发言情况。 原始文本是2014-03-28 15:04:25 №┽◎Eagle(369029696) 解析之后yyyy=2014mm = 03dd = 28hh = 15mi =04ss = 25nick = №┽◎Eagleqq = 369029696 代码如下 # -*- coding: utf-8 -*- """ ...
阅读全文
摘要:8. Errors and Exceptions Until now error messages haven’t been more than mentioned, but if you have tried out the examples you have probably seen some. There are (at least) two distinguishable kinds ...
阅读全文
摘要:7. Input and Output There are several ways to present the output of a program; data can be printed in a human-readable form, or written to a file for future use. This chapter will discuss some of the...
阅读全文
摘要:6. Modules If you quit from the Python interpreter and enter it again, the definitions you have made (functions and variables) are lost. Therefore, if you want to write a somewhat longer program, you...
阅读全文
摘要:5. Data Structures This chapter describes some things you’ve learned about already in more detail, and adds some new things as well. 5.1. More on Lists The list data type has some more methods. Here a...
阅读全文
摘要:4. More Control Flow Tools Besides the while statement just introduced, Python knows the usual control flow statements known from other languages, with some twists. 4.1. if Statements Perhaps the mo...
阅读全文
摘要:lambda函数和and - or技巧的使用 当collapse为true时,返回" ".join(s.split()),而当collapse为false时,则返回s processFunc = collapse and (lambda s: " ".join(s.split())) or (lambda s: s)这个函数主要着重于简单的模糊处理和默认参数处理def ask_ok(prompt...
阅读全文
摘要:if __name__=='__main__' 的原理说明
阅读全文

测试三种遍历列表方法的性能
python的一些基础知识和语法学习笔记
浙公网安备 33010602011771号