#!/usr/bin/python3 '''Output a file, one line at a time, with random sleeps between each line''' import sys import time import random def main(): '''Main function''' filename = sys.argv[1] assert not sys.argv[2:] with open(filename, 'r') as file_: for line in file_: sys.stdout.write(line) sys.stdout.flush() time.sleep(random.random() / 10.0) main()