poem = '''\
I love you more than anything.
'''
f = open('text05.txt','w') #提示[Error 13] Permission denied:'text05.txt'
f.write(poem)
f.close()
f = open('text05.txt')
while True:
line = f.readline()
if len(line) == 0:
break
print line,
f.close()
看网上说是文件未关闭还在运行或是路径的问题,但还不太知所以然,具体解决的办法是什么呢,困扰许久啊。(处于windows平台上)
你写文件的权限不够
以管理员身份运行你的脚本