line = fp.readline() if len(line)==0: break #..... Do what you want 其实,可以不用len判断,而用not判断。Python中,空串的not返回True,即not line时为读到EOF, ...
確定! 回上一頁