Apr-15-2022, 02:50 AM
Oder auch so?
All in one fell swoop!
@pd_minh12: if you use with open(myfile) as any_name_here: you don't need to worry about closing the file afterwards, it will be closed automatically!
All in one fell swoop!
@pd_minh12: if you use with open(myfile) as any_name_here: you don't need to worry about closing the file afterwards, it will be closed automatically!
myfile = '/home/pedro/summer2022/breakingnewsEnglish/heat_or_eat_UK.txt' with open(myfile) as mf: newList = mf.read().splitlines() for l in newList: print(l)