def population(): ret = [] with open('test.py', 'r', encoding='utf-8') as f: for i in f: ret.append() return ret g = population() print(g._next_())