This should do what you want (file contents in a list, by line, without \n) with open(filename) as f: mylist = f.read().splitlines().
確定! 回上一頁