09 2014 档案

摘要:文件结构- run.py- b-- __init__.pyrun.py 1 import logging 2 3 import b 4 5 log = logging.getLogger("") 6 7 tmp = logging.FileHandler('log.txt') 8 log.ad... 阅读全文
posted @ 2014-09-29 13:50 mess4u 阅读(516) 评论(0) 推荐(0)
摘要:函数参数的顺序def hello(greeting, name): print greeting + name如果记不清函数的参数顺序,可以在调用时hello(greeting = "hey", name = "jude")这样的话可以在看到函数调用时就知道参数做什么的也可以在定义的地方设置默认值d... 阅读全文
posted @ 2014-09-10 14:52 mess4u 阅读(323) 评论(0) 推荐(0)
摘要:在执行 import module 时 会从1 当前目录2 pythonpath(可以通过 os.sys.path 查看)3 python 安装目录b import 了 a, c import 了 b,c 中也会有定义test.py 1 __all__ = ['a', 'b'] 2 3 def a... 阅读全文
posted @ 2014-09-10 09:20 mess4u 阅读(166) 评论(0) 推荐(0)
摘要:Code1 a = [1,2,2,3]2 b = [for item in a if item not in b]3 4 c = []5 for item in a:6 if item not in c:7 c.append(item)b -- [1,2,2,3]c -- [... 阅读全文
posted @ 2014-09-05 10:51 mess4u 阅读(133) 评论(0) 推荐(0)