Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2007-02-02 02:31:04
Size: 1237
Editor: ZoomQuiet
Comment:
Revision 3 as of 2008-10-15 15:13:54
Size: 1338
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 非常正常的函式,好象?但是产生的魔力是惊人的!
Line 44: Line 45:
[[PageComment2]] ##[[PageComment2]]

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. 反馈

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

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