#--coding:utf-8--
#向指定文件中存储指定内容
def text_create(name,msg):
full_path = name+ '.txt'
file = open(full_path,'w')
file.write(msg)
file.close()
#从指定文件中读取文本内容
def read_text(name):
full_path = name + '.txt'
file = open(full_path,'r')
msg = file.read()
print msg
#测试
text_create('hello','hello world')
read_text('hello')
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)