state=True #can be set to {anyInterger,True,False} while state: #do a task #if task done change state to exit loop 因此,取决于执行循环时的state变量,type(state)可以是bool,int 但是要使用while从文件中读取行,如下所述 f=open('test.txt','r') line_data=[] line=f.readline() while line...