1、用户交互
输入:raw_input
a = raw_input("input:")
input:123
输出:print
print 'hello world'
hello world
2、文件类
file类方法如下:
f = file('poem.txt', 'w') # open for 'w'riting
f.write(poem) # write text to file
f.close() # close the file
3、储存与取储存
Python提供一个标准的模块,称为pickle。使用它你可以在一个文件中储存任何Python对象,之后你又可以把它完整无缺地取出来。这被称为 持久地 储存对象。