for line in file.readlines(): line=line.strip('\n') 转载于:https://www.cnblogs.com/wswang/p/5244990.html