标签:sid 处理 python2 int -- ssi code RoCE style
Python是没有swithch语句, 这点还是对于我们这些整Java/C/Shell/... 人都是很不习惯, 你得这样才行!
#!/usr/bin/env python2 junk = "shoo2" def shoo_fun1(): print "hello ok1" def shoo_fun2(): print "hello ok2" def shoo_fun3(): print "hello ok2" def default_fun(): print "default" sssDict = { ‘shoo1‘ : shoo_fun1, ‘shoo2‘ : shoo_fun2, ‘shoo3‘ : shoo_fun3, "defautl" : default_fun, } def processId(procID): sssDict[procID]() processId(junk)
标签:sid 处理 python2 int -- ssi code RoCE style
原文地址:https://www.cnblogs.com/bzhao/p/14383580.html