【冷知识】在python2.7或更早的版本中模拟类似3.x的print函数
虽然这样做没有必要因为一般情况下,我们可以有更好的方式去实现:例如使用from __future__ import print_function来实现:from __future__ import print_functionprint(123,456,end='',file = (open('temp.txt','w'))#它大致上等价于你在2.x内写 print >>o
原创
2015-12-31 13:18:02 ·
582 阅读 ·
0 评论