码迷,mamicode.com
首页 >  
搜索关键字:zen coding    ( 13130个结果
Python的classmethod和staticmethod区别
静态方法(staticmethod)类方法(classmethod)静态方法和类方法都可以通过类名.方法名或者实例.方法访问。#-*- coding:utf8 -*- ...
分类:编程语言   时间:2014-11-27 18:10:46    阅读次数:167
Python发送邮件
```python #!/usr/bin/env python # -*- coding: utf-8 -*- # Author: guojing # Date: 2014-10-23 # Purpose: 发送邮件 ‘‘‘ 发送邮件 Parameters:主题、接受者(多个用‘,‘分割)、抄送(多个用‘,‘分割)、内容(可以...
分类:编程语言   时间:2014-11-27 13:01:24    阅读次数:192
python爬取商品信息
老严要爬某网购网站的商品信息,正好我最近在学python,就一起写了一个简单的爬虫程序。需求:某网的商品信息,包括商品名,市场价和售价工具:python2.7.8,urllib2,re#coding = utf-8import urllib2import repath = "aaa.txt"f = ...
分类:编程语言   时间:2014-11-27 06:46:13    阅读次数:124
Python中使用ctypes调用Windows API
# -*- coding: cp936 -*-import ctypesimport ctypes.wintypes#print(dir(ctypes))#print(dir(ctypes.wintypes))user32 = ctypes.WinDLL("user32.dll")FindWindo...
分类:编程语言   时间:2014-11-27 01:31:10    阅读次数:749
Twisted 库 TCP 服务器 心跳包demo
最近刚刚接触 twisted 库,感觉twisted 库的设计模式和平时接触的socket 通信很大不同, 感觉有点不大适应,为了增加自己对twisted 的适应度, 同时也熟悉一下心跳包的机制。  特地写了一个  基于twisted 库的 TCP  服务器 心跳包 demo。 以供练习之用。 同时也和大家分享 python 编程心得  # -*- coding: utf-8 -*-...
分类:其他好文   时间:2014-11-26 19:08:37    阅读次数:190
python调webservice和COM接口
调webservice# -*- coding: cp936 -*-from suds.client import Clienturl = 'http://192.168.50.165/portal/remoting/ERMClientService?wsdl'client = Client(url...
分类:编程语言   时间:2014-11-26 18:16:12    阅读次数:194
python中json的操作示例
先上一段示例# -*- coding: cp936 -*-import json#构造一个示例数据,并打印成易读样式j = {}j["userName"]="admin"j["realName"]="管理员"j["cookie"]="afasfasfasdfasdfasf"print json.du...
分类:编程语言   时间:2014-11-26 16:10:02    阅读次数:263
kvc
KVC,即:Key-value coding,它是一种使用字符串标识符,间接访问对象属性的机制,它是很多技术的基础。主要的方法就两个,setValue:forKey,valueForKey在Programming Guide中说,使用KVC可以简化代码,但事实上使用起来,还是要看具体情况。代码实例:...
分类:其他好文   时间:2014-11-26 14:03:55    阅读次数:192
对Linux上的各类型压缩格式的一个总结
我使用的环境是64位的 Red Hat Enterprise Linux Server release 6.4 (Santiago) 1.compress与*.Z文件 compress程序的作用是:Compress reduces the size of the named files using adaptive Lempel-Ziv coding 即...
分类:系统相关   时间:2014-11-25 23:56:19    阅读次数:491
python goatools使用
用david搞定了所有的GOterm后,接下来就是利用goslim处理这些term。用的包是goatools,需要下载几个obo文件以及,fisher,pygraphviz以及graphviz等几个模块。# -*- coding: utf-8 -*-"""Created on Fri Nov 21 ...
分类:编程语言   时间:2014-11-25 17:55:06    阅读次数:1031
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!