- 帖子
- 25
- 精华
- 0
- 积分
- 72
- 阅读权限
- 20
- 注册时间
- 2018-4-5
- 最后登录
- 2018-10-21
|
crossin先生 发表于 2018-4-9 23:16
因为死循环了啊
程序里多增加一些print输出你就看出来了 - #homework.No.2
- #司南 2018.04.09
- #从控制台输入内容,保存至文件
- string=input('You can add any words to the document,Please begin,and end with "done"')
- while string!="done":
- print(string)
- f_desk=open('desk.txt','a+')
- f_desk.write(string+'\n')
- f_desk.close()
- string=input('You can add any words to the document,Please begin,or end with "done"')
- print(string)
- f=open('desk.txt')
- data1=f.read()
- print(data1)
- f.close()
复制代码 Crossin先生,这个加了print试了一下,每次print也是对的,但是一点输入done,python就是转圈圈,未响应,您知道为啥麽 |
|