随笔分类 - python
python is fun!
摘要:./pyModuleTest/├── addutil│ ├── add.py│ ├── add.pyc│ ├── __init__.py│ ├── __init__.pyc│ └── readMe.txt└── utilModuleTest.py #!/usr/bin/env python # -*
阅读全文
摘要:Pycharm在创建py文件时,如何自动添加文件头注释(类似于钩子特性)?
阅读全文
摘要:Python 函数传递list,传递dict 以及*args和**kargs 函数之间传递list: *args:输入数据长度不确定,通过*args将任意长度的参数传递给函数,系统自动将任意长度参数用list(tuple定长,特殊的list)表示 **kargs:输入数据长度不确定,系统自动将任意长
阅读全文
摘要:RobotFrameWork(三)数据类型 1.1 数字变量 执行结果: 1.2 布尔变量和None/null 执行结果: 1.3 字符串、元组、list和字典 执行结果: 1.4 space和empty 执行结果:
阅读全文
摘要:1 body = {} 2 3 item = {} 4 item['one'] = 'vip1' 5 item['two'] = 'vip2' 6 body.update({'vip':item}) # not exist 7 print(body) 8 9 # if exist 10 item['
阅读全文
摘要:模块名: 小写字母,单词之间用_分割 参考python:logging 包名: 小写字母,单词之间用_分割 参考python:logging 类名: 单词首字母大写 参考:python class LogRecord(object): 普通变量: 小写字母,单词之间用_分割 参考:exc_info
阅读全文
摘要:验证/参考资料 1. >>> s='aaa111aaa,bbb222,333ccc,444ddd444dd,555eee666eee,fff777ggg' >>> re.findall(r'(?P<file>[a-z]+)\d+(?P=file)', s) 以(?P<file>\d)hellowor
阅读全文
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- # 在定义或者调用参数时,参数的几种传递方式可以混合。基本原则是,先位置,再关键字,再包裹位置,再包裹关键字。 # -------------------------------------------------------------------- # # 位置参数 def func(a, b,...
阅读全文
摘要:mro即method resolution order,主要用于在多继承时判断调的属性的路径(来自于哪个类)。 http://blog.csdn.net/imzoer/article/details/8737642 你真的理解Python中MRO算法吗? API: 测试代码: 输出: enter C
阅读全文
摘要:1. 快捷键 格式化代码:Ctrl + Alt + L 2. A scheme with this name already exists or was deleted without applying the changes 解决办法:$cd ~/.PyCharm2016.2/config/col
阅读全文
摘要:pygame参考文档pdf版:pygame API html版 pygame API 石头剪子布的简单小游戏,待改进的地方,自适应大小.感兴趣的小伙伴可以依据get_surface()返回值(即当前窗口大小比率)来确定.
阅读全文
摘要:1.参考资料问题: 现在django发布了1.11版本,离线文档下载引擎地址 文档下载地址 在线文档:https://docs.djangoproject.com/en/1.10/intro/tutorial01/ 2.Django的admin后台定制问题 官方参考地址 2016-11-10 Dja
阅读全文
摘要:django入门代码示例小博客:https://pan.baidu.com/s/1pLjLPSv 1.自动补全功能 许多人都知道 iPython 有很好的自动补全能力,但是就未必知道 python 也同样可以 Tab 键补全,您可以在启动 python 后,执行下 import readline,
阅读全文