#!/usr/bin/env python3 import sys # We want to pass in the file name as a commandline argument if len(sys.argv) < 2: print('You must specify a file') exit() path = sys.argv[1] # We need to make sure the file exists try: # Open file # Read the file as a string # Split the file into a list of strings # print each line in the list [print(line) for line in open(path).read().splitlines()] # another option # [print(line, end='') for line in open(path).readlines()] except FileNotFoundError: print('File not found') exit()