随笔分类 -  Python

摘要:http://www.cnblogs.com/linyawen/ 基础的和非基础的都有了http://www.cnblogs.com/huxi/ 主要集中在functional programming~http://obmem.info/ 爬吧。。。 阅读全文
posted @ 2013-07-19 14:43 Tilney 阅读(90) 评论(0) 推荐(0)
摘要:1. lambda2.apply(), filter(), map(), reduce()这四个built-in functions. 阅读全文
posted @ 2013-07-18 15:20 Tilney 阅读(105) 评论(0) 推荐(0)
摘要:1.file_object = open(file_name, access_mode='r', buffering=-1)关于acess_mode的解释File Mode Operationr Open for readrU or U Open for read with universal NEWLINE support (PEP 278)w Open for write (truncate if necessary)a Open for append (always works from EOF, c... 阅读全文
posted @ 2013-07-17 15:32 Tilney 阅读(129) 评论(0) 推荐(0)
摘要:1. 将list转换成字符串;1 >>> li = ['t', 'r', 'u', 's', 't']2 >>> str(li)3 "['t', 'r', 'u', 's', 't']"4 >>> ''.join(li)5 'trust'str()只是单纯的将其转换成一个字符串,不会讲list的元素连接。 阅读全文
posted @ 2013-07-11 14:41 Tilney 阅读(141) 评论(0) 推荐(0)
摘要:UnboundLocalError: local variable 'stack' referenced before assignment声明一个全局变量,可以在局部修改或者读取,但是如果你要在局部读取并修改,需要在局部作用域声明 global stack, 否则编译器会将其视为局部变量,抛出题示错误。 阅读全文
posted @ 2013-07-11 10:00 Tilney 阅读(283) 评论(0) 推荐(0)