Differences between revisions 1 and 2
Revision 1 as of 2007-02-02 02:31:04
Size: 1237
Editor: ZoomQuiet
Comment:
Revision 2 as of 2007-02-02 02:33:33
Size: 1336
Editor: ZoomQuiet
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
[[Include(/EffectivePyEn)]]
Line 19: Line 20:
 * attachment:dictfunc.png
Line 21: Line 21:
 * attachment:dictfunc.png 非常正常的函式,好象?但是产生的魔力是惊人的!

Effective--实效Python编程

TableOfContents

Include(CPUGnav)

1. Effective Py Pregramming

1.1. 试译

Include(/EffectivePyEn)

1.2. 体验

   1 callDict = { 
   2     'FOZZIE': showFozzie,
   3     'KERMIT': showKermit,
   4     }
   5 # 然后就可以如此影响各种情况了
   6 func = callDict.get("FOZZIE", showUnknownMuppet)
   7 func()
   8 # 简化版本的..
   9 callDict.get("SomeMatterTarget", 
  10     showUnknownMuppet)()
  11 
  12 def showFozzie():
  13     print "showFozzie"
  14 def showKermit():
  15     print "showKermit"
  16 def showUnknownMuppet():
  17     print "showUnknownMuppet"

2. 反馈

PageComment2

::-- ZoomQuiet [DateTime(2007-02-02T02:31:04Z)]

EffectivePyPrgramming (last edited 2011-05-11 05:56:22 by ZoomQuiet)