python按行读取文件,如何去掉换行符"\n"

    for line in file.readlines():
        line=line.strip('\n')

 

posted @ 2016-07-27 11:33  巫谢  阅读(1806)  评论(0编辑  收藏  举报