python文件操作

按行讀取文本,當讀取到的那一行爲空時,跳出循環 file = open("readme") while True: text = file.readline() if not text: break print(text,end="") file.close()
相關文章
相關標籤/搜索