1、 _ 解释器中有特别含义,表示最后一个表达式的值
2、
>>> mystr = 'hello world'
>>>print mystr
hello world
>>>mystr
'hello world'
区别在于第二个不仅显示内容,而且显示类型
print 是 str()函数 交互式解释器则调用 repr()函数。
3、print重定向
import sys
print >> sys.stderr,'sdfsfsd'
log = open('c:/a.txt','a')
print>>log,'sdfsdfsdfsd'
log.close()
4、help(对象名)
python 帮助的用法
Python打印与帮助使用技巧
7万+

被折叠的 条评论
为什么被折叠?



