¹ØÓÚpython class£º callerRefµÄÎÊÌâ
Python code:
class A:
def __init__(self):
self.B_Handle = B_Handle
self.VA = "A_init"
print "Class A init"
def __getattr__(self, name):
print "A.__getattr__"
print "name=%s" % name
def callref(self, callref="A",):
print "A.callref = %s" % callref
return self.B_Handle.callref(self, callref)
class B:
def __init__(self):
self.VB = "B_init"
print self.VB
def callref(self, [color=#FF0000]callerRef,[/color] callref):
print "B.callref = %s" % callref
B_Handle = B()
if __name__ == "__main__":
print "eval callerRef start"
a = A()
a.callref()
ÔËÐнá¹û£º
>>> B_init
eval callerRef start
Class A init
A.callref = A
B.callref = A
¿´µ½Ò»¶ÎÕâÑùµÄ´úÂ룬 ¶ÔÆäÖеÄcallerRef²»ÊǺÜÀí½â£¬Çë¸ßÊÖÖ¸µã£¡
ÖØ·¢class B ´úÂ룺
Python code:
class B:
def __init__(self):
self.VB = "B_init"
print self.VB
def callref(self, [color=#FF0000]callerRef,[/color] callref):
print "B.callref = %s" % callref
Ïà¹ØÎÊ´ð£º
ÇëÎÊÏ£¬ÎÒµÄÊÇpython2.5°²×°ÁËPILÄ£¿é£¬È»ºó±àд³ÌÐò´ò¿ª±¾»úÉϵÄÒ»¸öͼƬʱ£¬ÎªÊ²Ã´ÀϳöÏÖ´íÎóÄØ£¬ÀÏÊÇÕÒ²»µ½Í¼Æ¬£¬´íÎóÌáʾÈçÏ£ºFile "C:\Python25\Lib\site-packages\PIL\Image.py", line 1888, in o ......
Ïñ C µÄ scanf() ÄÇÑù
±ÈÈç¶ÁÈë 1 2 3 a b c
ÿ´Î¶ÁÈëÒ»¸ö
ÏÂÃæÕâ¸öÓ¦¸ÃÊÇÄãÏëÒªµÄ°É£º
Python code:
>>> k = raw_input()
0 0123 ds dsl sd
>>> k
'0 0123 ds dsl sd'
>>> ......
ÎÒÿ´ÎÉÏ´«µÄÎļþ¶Áµ½µÄÊý¾Ý¶¼²»ÕýÈ·¡£2M µÄͼƬ¶ÁµÃ10¶àK ¡£¡£ÄÄλ´óÏÀ¿ÉÒÔ°ï°ïÎÒ°¡¡£
#!D:\ProgrammerTools\python26\python.exe
#encoding=utf-8
import cgitb
import os
cgitb.enable()
import cgi,urllib ......
pythonµÄPIL¿â×Ô´øµÄ·½·¨Ö»ÄܽøÐоØÐεÄÇиÈç¹ûÎÒÓÐÁËÒ»¸ö¶à±ßÐθ÷¸ö¶¥µãµÄ×ø±ê£¬ÈçºÎ¶ÔÏÖÓеÄͼƬ°´ÕÕÕâ¸ö¶à±ßÐνøÐÐÇиîÄØ£¿
²»Ò»¶¨ÒªÓÃPIL¿â£¬ÈκÎÄÜʵÏÖÕâ¸ö¹¦Äܵķ½·¨¶¼ÐС£
ͼƬÇиîµÄjs²»ÊǺܶàÂð£¿
......
ѧϰpythonµÄ7±¾Êé
°üÀ¨6±¾chm£¬Ò»±¾pdf×ÊÁÏ
¶ÔѧϰpythonÓкܴóµÄ°ïÖú
http://download.csdn.net/source/619791
¾«ÐÄËѼ¯£¬²»Òª»ý·Ö£¬ÄóöÀ´·ÖÏí
лл¥Ö÷£¬ÐÁ¿àÁË~
lz ×îºÃ°ÑÊéÃûºÍ¼òµ¥½éÉܼÓÉ ......