文章目录: __call__ __iter__ yeild arrage __call__ 可调用对象 #!/usr/bin/env python#!-*-coding:utf-8-*-''' switch (C+) @author xyt 可调用对象'''clas...
分类:
编程语言 时间:
2014-10-13 21:13:27
阅读次数:
271
#!/usr/bin/env python#-*- coding:utf-8 -*-#File:mail_send.pyclass Mail_Logger(): mailLogger = None def __init__(self,conf_file,name): imp...
分类:
编程语言 时间:
2014-10-13 18:27:31
阅读次数:
167
本人刚开始接触python,在oj上解一些简单的题,欢迎交流,不喜勿喷.
http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1110&cid=1278
#!/usr/bin/env python
# coding=utf-8
print 'Hello World!'
http://acm.sdut.edu.cn/sdutoj/s...
分类:
编程语言 时间:
2014-10-13 13:27:38
阅读次数:
337
无意将hdfs上的hbase文件(hbase的rootDir为hdfs:master1:9000/hbase)删掉了,重启hbase和ZK都不行 解决方案:使用hbase的ZK 即设置 hbase-env.sh 中的 ?HBASE_MANAGES_ZK 为 true 在重启hbase 即可生成hbase文...
分类:
其他好文 时间:
2014-10-11 21:04:37
阅读次数:
274
Python 3版本pattern_create.rb工具,用于计算溢出发生时被覆盖元素偏移地址。#!/usr/bin/env python# Replicates msf pattern_create.rbimport systry:length=int(sys.argv[1])except:pr...
分类:
编程语言 时间:
2014-10-10 20:12:54
阅读次数:
504
本随笔是对Python札记 -- 装饰器的一些补充。 使用装饰器的时候,被装饰函数的一些属性会丢失,比如如下代码: 1 #!/usr/bin/env python 2 3 def deco(func): 4 def wrapper(): 5 print "Wrap sta...
分类:
编程语言 时间:
2014-10-10 18:58:14
阅读次数:
189
UNIX env查找技巧 在一些UNIX系统上,可以用这样一种方法避免硬编码Python解释器的路径,在文件的特定的第一行注释中写上这样一句话。#! usr/bin/env/ python...script goes here 这样写之后,env程序可以通过系统搜索路径的搜索设置(例如,在绝...
分类:
编程语言 时间:
2014-10-10 13:40:34
阅读次数:
375
#!?/usr/bin/env?python
#?-*-?coding:?utf-8?-*-
################################################################################
#
#?Copyright?(c)?2014?Baidu.com,?Inc.?All?Rights?Res...
分类:
系统相关 时间:
2014-10-09 22:44:28
阅读次数:
309
#!/usr/bin/env pythonimport paramikoimport sys,oshost = 'git' #IP地址或在hosts文件中绑定主机名IPuser = 'root' #系统用户名password = '123' #密码s = paramiko.SSHClient() ....
分类:
编程语言 时间:
2014-10-09 14:32:13
阅读次数:
318
简单工厂模式属于类的创建型模式,适合用来对大量具有共同接口的类进行实例化,它可以推迟到运行的时候才动态决定要创建哪个类的实例,而不是在编译时就必须知道要实例化哪个类。
python:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Circle(object):
def draw(self):
print 'dra...
分类:
编程语言 时间:
2014-10-09 01:40:38
阅读次数:
229