摘要:
写了一阵子python脚本了,今天写个小功能时用了n多if...else,看着真让人厌烦,然后就想看看python的switch...case怎么用,在网上找了半天,才知道python是没有自带switch...case语句的,还好找到一个不错的例子,在此记录,以备后用。代码来自:http://code.activestate.com/recipes/410692/ 1 #!/bin/env python 2 #coding=utf-8 3 4 # This class provides the functionality we want. You only need to look a... 阅读全文
摘要:
1 print 'Hello World'Just For Test! 阅读全文