摘要:
1.__qualname__A dotted name showing the “path” from a module’s global scope to a class, function or method defined in that module, as defined inPEP 3155. For top-level functions and classes, the qualified name is the same as the object’s name:一个显示从从定义该对象的模块到到达该对象(类,函数,方法)所经路径的带.号的名字?对于top-level的类和方法 阅读全文
摘要:
1 # -*- coding: utf-8 -*- 2 def check_func(a): 3 print("__name__:",a.__name__) 4 print("__doc__:",a.__doc__) 5 print("__qualname__:",a.__qualname__) 6 print("__defaults__:",a.__defaults__) 7 print("__code__:",a.__code__) 8 print("__globals__:&qu 阅读全文
摘要:
http://www.u148.net/article/1048.html 阅读全文
摘要:
import socket host = ''port = 51234s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) #SOCK_STREAM means tcps.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) #SO_REUSEADDR : after close socket,free the ports.bind((host,port))print("waiting for connecting")s.listen(1) #general 阅读全文
摘要:
>>> a = 6>>> tup = (a,5)>>> id(a)137396080>>> tup(6, 5)>>> id(tup[0])137396080>>> a = 7>>> id(a)137396096 阅读全文
摘要:
"windows vimperator : /media/C/Users/Administrator/_vimperatorrclet mapleader=",""----------school----------map<leader>sc :tabopen www.scut.edu.cn<cr>map<leader>jw :tabopen www.scut.edu.cn/jw2005<cr>map<leader>zx :tabopen http://222.16.42.161/eol/hom 阅读全文
摘要:
from:http://hi.baidu.com/rails7/item/9afc0b30fd1544c02e8ec299关于Python的super用法研究一、问题的发现与提出在Python类的方法(method)中,要调用父类的某个方法,在Python 2.2以前,通常的写法如代码段1:代码段1:class A:def __init__(self): print "enter A" print "leave A"class B(A):def __init__(self): print "enter B" A.__init__(se 阅读全文
摘要:
Want to write shorter, cleaner code? Have an unfortunate situation where you need to fit as much as you can in one expression? Prefer a quick dose of hacks to spending the rest of your life reading the docs? You've come to the right place. We start out with some quick tricks that you might have 阅读全文