• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Williamzon
https://docs.python.org/2/library/index.html
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  Python

django for windows

摘要:http://canbeatle.iteye.com/blog/204739 阅读全文
posted @ 2015-09-06 22:07 Williamzon 阅读(171) 评论(0) 推荐(0)
python 查找指定内容的txt文件

摘要:程序设计思路:1. 利用os.walk()找出所有的文件;2.利用正则找到指定后缀的文件;3.找到需要的txt文件后,通过open().readlines()读取文件中每行数据;4.读取后,保存正则匹配到数据的文件;5.你懂的。#!/usr/bin/env python#coding:utf8imp... 阅读全文
posted @ 2015-09-01 11:13 Williamzon 阅读(13169) 评论(0) 推荐(1)
python 图片爬虫

摘要:#!/usr/bin/env python#coding:utf-8import urllibimport redef GetHtml(url): """获取HTML页面所有元素.""" page = urllib.urlopen(url) html = page.read() ... 阅读全文
posted @ 2015-08-18 17:38 Williamzon 阅读(241) 评论(0) 推荐(0)
switch 与 python字典

摘要:python 中并没有switch语句,但是有一个数据类型与switch语句特别相似,它就是 dict{ key: value, ...}下面用 dict{ key:value,..} 来简单的实现switch语句:#!/usr/bin/env python#coding:utf-8from __f... 阅读全文
posted @ 2015-08-14 07:46 Williamzon 阅读(201) 评论(0) 推荐(0)
python中函数接收多余参数

摘要:代码:def fun(x): return x print fun(10)函数fun(x)接受参数是x,传入数字"10",打印函数的返回值结果 就是10,如果我传递多个参数时,程序就会出错,如下图:def fun(x): return xprint(fun(10,20))Trace... 阅读全文
posted @ 2015-08-13 10:01 Williamzon 阅读(1976) 评论(0) 推荐(1)
centos 更新python

摘要:1、CentOS安装Python的依赖包yum groupinstall "Development tools"yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-... 阅读全文
posted @ 2015-07-20 10:30 Williamzon 阅读(190) 评论(0) 推荐(0)
debuggee python

摘要:my_debugger_defines.py 1 #encoding:utf-8 2 3 from ctypes import * 4 from sys import version as py_ver 5 6 # In python 2.7.6, LPBYTE is not defined i... 阅读全文
posted @ 2015-07-15 14:10 Williamzon 阅读(378) 评论(0) 推荐(0)
递归函数 Python

摘要:函数:def fact(n): if n==1: return 1 return n * fact(n-1)递归过程:print(fact(5))>>fact(5)>>5 * fact (4)>>5 * (4 * fact(3))>>5 * (4 * (3 * fact(2)))>>5 *... 阅读全文
posted @ 2015-06-17 10:30 Williamzon 阅读(146) 评论(0) 推荐(0)
* 和 ** python

摘要:*代表tuple集合,**代表dictdef func(a, b, c=0, *args, **kw) print ('a=',a, 'b=',b,'c=',c,'args=',args,'kw=',kw)>> func(1,2,c=3)>>a=1 b=2 c=3 args=() kw={}>>f... 阅读全文
posted @ 2015-06-17 10:02 Williamzon 阅读(170) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3