//修改1
摘要: 源文件每行后面都有回车,所以用下面输出时,中间会多了一行 try: with open("F:\\hjt.txt" ) as f : for line in f: print(line) except FileNotFoundError: print("读取文件出错") 有两种方法处理: 1.print后面带 end='',表示不换行 t... 阅读全文
posted @ 2019-07-13 21:54 zhengyunbo66 阅读(2804) 评论(0) 推荐(0) 编辑
摘要: active =True while active: message =input("\nPlease input your name:\n") if message =='q': break print("welcome " + message + " come to our website!") with open('guest_book... 阅读全文
posted @ 2019-07-13 21:49 zhengyunbo66 阅读(6295) 评论(0) 推荐(0) 编辑