python
blacklaw0
这个作者很懒,什么都没留下…
展开
-
python_8荣8耻
以动手实践为荣 , 以只看不练为耻;以打印日志为荣 , 以单步跟踪为耻;以空格缩进为荣 , 以制表缩进为耻;以单元测试为荣 , 以人工测试为耻;以模块复用为荣 , 以复制粘贴为耻;以多态应用为荣 , 以分支判断为耻;以Pythonic为荣 , 以冗余拖沓为耻;以总结分享为荣 , 以跪求其解为耻;转载 2013-05-18 19:27:06 · 613 阅读 · 0 评论 -
python_为什么没有DO WHILE和switch
http://bbs.chinaunix.net/thread-1763180-1-1.htmlDO WHILE实现do{ input = get_input()} while( input != something )复制代码while if 應該滿足到你需要吧.while Tru原创 2013-05-06 12:10:02 · 4821 阅读 · 0 评论 -
python_运算符重载
在Python语言中提供了类似于C++的运算符重在功能:一下为Python运算符重在调用的方法如下:Method Overloads Call for__init__ 构造函数 X=Class()__del__ 析构函数 对象销毁__add__ +转载 2013-07-28 21:46:24 · 488 阅读 · 0 评论 -
python_urllib,urllib2模块
http://blog.csdn.net/wklken/article/details/7059423前阶段使用到ftp,写了个工具脚本最近需要抓网页,看了下python抓取方式 需求:抓取网页,解析获取内容涉及库:【重点urllib2】urllib http://docs.python.org/library/urllib.转载 2013-05-15 07:46:41 · 579 阅读 · 0 评论 -
python_读书笔记
Title:《Python入门经典》StartDate: 2013-5-5EndDate: 2013-5-7ISBN: 978-7-111-39413-6大牛:http://blog.csdn.net/lanphaday交互式会话,模块,表达式和语句,空白,续行,缩进,注释关键词,标点分隔符,字面量,变量,对象,ID号,id(),type(),isinstance(原创 2013-05-07 22:55:02 · 537 阅读 · 0 评论 -
python_知识点补充
title:Author:Jeff ForcierISBN:978-7-111-27028-7匿名函数sorted(list_of_people, key = lambda person: person.last_name)* 和 *** 打开tuple或list**打开dictdef check_web_server(host, port, path, *原创 2013-05-08 12:42:31 · 480 阅读 · 0 评论 -
python_异常列表
http://www.python.org/dev/peps/pep-0348/+-- BaseException (new; broader inheritance for subclasses) +-- Exception +-- GeneratorExit (defined in PEP 342 [1]) +-- StandardError原创 2013-05-07 21:46:32 · 566 阅读 · 0 评论 -
python_eclipse,django搭建
http://hi.baidu.com/yobin/item/baecef34c9a373d46d15e95d转载 2013-05-07 18:40:15 · 423 阅读 · 0 评论 -
python_处理输入异常技巧
while True: try: valueStr = raw_input("Input integer: ") valueInt = int(valueStr) break except ValueError: print "Bad input."一进去就死循环,除非正确才把你放出来,够狠的~!~原创 2013-05-07 22:07:08 · 971 阅读 · 0 评论 -
python_运算符重载
http://docs.python.org/2/reference/datamodel.html数学类运算符x + y __add__()x - y subx * y mulx / y divx==y eqx > y gtx>=y gex xx!=y ne序列运算符len(x) __len__()x in y原创 2013-05-07 20:38:47 · 537 阅读 · 0 评论 -
python_调用c,c++模块
参考:http://blog.sina.com.cn/s/blog_6982136301010rsj.html//testc.c//gcc -o testc.so -shared -fPIC testc.c#include int foo(int a, int b) { printf("this is c so Your input %i and %原创 2013-05-20 18:01:28 · 515 阅读 · 0 评论 -
python_异常解决
找不到pylabsudo apt-get install python-matplotlib原创 2013-05-06 12:20:36 · 546 阅读 · 0 评论 -
python_pyopengl,pygame
pyopengl:http://sourceforge.net/projects/pyopengl/glut问题解决:http://stackoverflow.com/questions/10188595/pyopengl-typeerror-nonetype-object-is-not-callablepygame:http://www.pygame.org/ sud转载 2013-05-19 09:34:16 · 787 阅读 · 0 评论 -
python_Python小技巧之除法运算、幂运算
Python小技巧之除法运算、幂运算 不管是啥语言都离不开加减乘除这些算法,但是在Python里面你知道这些符号代表什么运算吗? “/”这个是除法运算,那么这个“//”呢?“*”这个是乘法运算,那么这个“**”呢?下面来一一介绍下。“//”运算 除法运算符是“/”,这个人人皆知道,但是这个二元运算符“/”求出来的结果都是转载 2013-05-06 09:44:01 · 28240 阅读 · 0 评论 -
python_几句话入门Python自带编辑器IDLE
【转】几句话入门Python自带编辑器IDLE转自:Python编辑器IDLE傻瓜入门 下载python进行安装,默认自带此工具开始->程序->Python 2.*/3.*-> IDLE (Python GUI)如此就打开了Python Shell->File->New window(Ctrl+N)就出现了python编辑器编写代码比如print('Hello转载 2013-05-06 09:26:40 · 3855 阅读 · 0 评论 -
python_模拟表单上传文件
这个有点难找,我的需求是这样的,在bae上我需要模拟一个浏览器的动作把bae上的文件传到另一个服务器上网上都是安装其他模块,或者curl实现但是bae是无法安装其他模块的,curl和socket也被禁用了,这里我用urllib2实现了'''Created on Sep 7, 2013@author: blacklaw'''import urllibimport urll原创 2013-09-08 15:13:45 · 1848 阅读 · 0 评论