
python
文章平均质量分 67
metecyu
这个作者很懒,什么都没留下…
展开
-
python if语句
#coding=utf-8'''Created on 2013-3-4@author: TonyYu'''# if语句def tstIf(): number = 23 guess = int(raw_input('Enter an integer : ')) if guess == number: print 'Congratulations,原创 2013-04-03 15:32:24 · 656 阅读 · 0 评论 -
循环语句
#coding=utf-8'''Created on 2013-3-4@author: TonyYu'''# 循环数组def forArray(): x = [1,2,3,4] for i in x: print i else: print 'finished!' # 循环一个String的chardef原创 2013-04-03 15:30:37 · 590 阅读 · 0 评论 -
python读取大盘指数
#coding=utf-8import HTMLParserimport timeimport urllib2# 继承语法class MyParser(HTMLParser.HTMLParser): targetid = '' def __init__(self,targetid): HTMLParser.HTMLParser.__原创 2013-04-03 15:35:48 · 2337 阅读 · 0 评论 -
eclipse+pydev 开发wxpython
windows下wxPython开发环境安装与配置博客分类: pythonwxPythonWindowsPythonEclipseMicrosoft 安装文件准备:安装文件下载地址python-2.6.2.msihttp://www.python.org/download/wxPython2.8-win32-u转载 2013-04-03 16:28:54 · 1375 阅读 · 0 评论 -
word转pdf
#coding=utf-8import sys, osimport timefrom win32com.client import Dispatch, constants, gencachedef usage(): sys.stderr.write ("doc2pdf.py input [output]") sys.exit(2)def doc2pdf(input, o转载 2013-04-03 15:33:34 · 853 阅读 · 0 评论 -
python for语句
#coding=utf-8'''Created on 2013-3-4@author: TonyYu'''# 循环数组def forArray(): x = [1,2,3,4] for i in x: print i else: print 'finished!' # 循原创 2013-04-03 15:39:44 · 875 阅读 · 0 评论 -
python正则表达式-findall
python正则表达式-findall#coding=utf-8import re '''# 获取匹配的的内容'''p = re.compile(r'\d+') print '找出所有的数字',p.findall('one1two2three3four4') '''# 获取匹配的的内容-比较复杂的例子'''unicodePage ='i am a boyi am原创 2015-02-23 21:43:30 · 3363 阅读 · 0 评论 -
python中编码总结
python中编码总结:1 python默认使用程序文件的编码对中文字符串进行编码,所以utf-8 、gbk程序的记录的中文是不同的编码2 可以强制使用unicode编码进行编码,使用u字符3. utf-8 每个中文占用3个字节 \xe8\x80\x834 gbk 每个中文占用2个字节 \xbf\xbc5 编码介绍编码规则原创 2015-02-28 16:15:57 · 1056 阅读 · 0 评论