Quantcast
Channel: tianwei » Python
Browsing latest articles
Browse All 10 View Live

Image may be NSFW.
Clik here to view.

Python测试框架小结

1.关于测试 黑盒测试 白盒测试 2.Python测试框架 目前流行的测试框架及工具(部分摘自http://agiletesting.blogspot.com/2005/11/exciting-times-in-python-testing-world.html) 2.1 unit testing py.test :py.test 框架建立了 Python...

View Article



Image may be NSFW.
Clik here to view.

Python语言技巧

1. 三元运算符 根据PEP, 语法为: X if C else Y (等价 C?X:Y) 2. shutil.rmtree 批量删除目录 删除指定路径目录下文件。在windows下该函数不能删除只读文件,需要改变文件属性。需要捕捉,然后改变属性。 代码示例如下: ?View Code PYTHON1 2 3 4 5 6 7 8 9 10 11 12 def...

View Article

Image may be NSFW.
Clik here to view.

Django 学习笔记(一)

由于GSOC2012项目中要用到Django,开始系统学习Django开发网站。 1. 快速安装 tar zxvf *.tar.gz sudo python setup.py build && python setup.py install 2. HelloWorld 程序 $ django-admin.py startproject helloworld $ cd...

View Article

Image may be NSFW.
Clik here to view.

PyGTK 使用技巧

1. 用Box 实现不同控件切换 Box 添加 各种控件,通过set_visible 来设定当前显示那个页面

View Article

Image may be NSFW.
Clik here to view.

Python 正则表达式

1. 网页资源 http://wiki.ubuntu.org.cn/Python%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%93%8D%E4%BD%9C%E6%8C%87%E5%8D%97 http://www.cnblogs.com/wei-li/archive/2012/05/16/2505503.html...

View Article


Image may be NSFW.
Clik here to view.

Python资源

Linux系统运维 1. http://wuhan88.bitbucket.org/#2 Tmall Python运维经验 Data Mining 1. http://vdisk.weibo.com/s/9ip5Y/1351409578 2. python for data analysis  

View Article

Image may be NSFW.
Clik here to view.

Django 学习笔记(三)

Django + Apache + mod_python 配置 1. 软件安装 sudo apt-get install apache2 sudo apt-get install libapache2-mod-python python-sqlite sudo apt-get install python-django 其他软件安装: sudo apt-get install python-dev...

View Article

Image may be NSFW.
Clik here to view.

Django 学习笔记(二)

Django常用命令 1.创建Admin管理账户 python manage.py createsuperuser 2.   常见问题解决 1. Admin页面 You don’t have permission to edit anything. 方法:在urls.py中add admin.autodiscover()...

View Article


Image may be NSFW.
Clik here to view.

Python 语言技巧

1. 函数 @ 修饰符 http://www.python.org/dev/peps/pep-0318/ 2. __new__ 与 __init__ new的优先级更高一些 __new__ 一般用于继承内置类,返回的是一个对象,可以应用在单例模式中;相当与JAVA里面的构造器 __init__ 只做初始化工作,没有返回值。...

View Article


Image may be NSFW.
Clik here to view.

SimpleJson 使用技巧

1. 将一个object 类(复杂的嵌套类)序列化成Json class A(object): time = None str = None list = None externObject = None class B(object): b1 = None b2 = None class C(object): c1 = None def main(): a = A() a.time =...

View Article
Browsing latest articles
Browse All 10 View Live




Latest Images