import os os.system("dir") #再如 os.system('mpg123 "%s"'%(url)) python按行读取文件 如何去掉换行符"\n" for line in file.readlines(): line=line.strip('\n') 这里使用了strip去掉每行结束的\n