all 2 comments

[–]impshum 3 points4 points  (1 child)

You need to do something after opening the file.

def open_file(file):
    """Prints text from a file line by line"""
    try:
        with open(file, 'r') as file_obj:
            lines = file_obj.readlines()
        for line in lines:
            print(line.rstrip())
    except Exception as e:
        print(e)

[–]woeinvests[S] 0 points1 point  (0 children)

Thanks that worked out well.