摘要:
Python内置了一些非常有趣但非常有用的函数,充分体现了Python的语言魅力! filter(function, sequence):对sequence中的item依次执行function(item),将执行结果为True的item组成一个List/String/Tuple(取决于sequence的类型)返回: >>> def f(x): return x % 2 != 0 and x % 3 != 0 >>> filter(f, range(2, 25)) [5, 7, 11, 13, 17, 19, 23] >>> def f(x) 阅读全文
posted @ 2012-12-06 17:43
garfieldtom
阅读(743)
评论(0)
推荐(0)
摘要:
ipython是一个很不错的调试工具,多谢园友zhuangzhuang1988提示。在Ubuntu下,安装ipython很简单:$sudo apt-get install ipythonUbuntu默认的python为2,所以如果要使用ipython3需要运行$sudo apt-get install ipython3如果想要使用ipython-qt,对于python2而言可以直接在软件中心中安装(当然,ipython也可以),对于ipyhon3-qt,则要麻烦一些。$sudo apt-get source python-slip$sudo apt-get python-qt4然后对于新下载的 阅读全文
posted @ 2012-12-06 14:42
garfieldtom
阅读(17787)
评论(0)
推荐(0)