[Solved] Input from a file [closed]


You can read all data at a moment:

with open(input_file, 'r', encoding='utf-8') as f:
    data = f.read()

You can read all data line-by-line:

with open(input_file, 'r', encoding='utf-8') as f:
    for line in f.readlines():
        # todo smth

solved Input from a file [closed]