import sys, string import numpy as np # Get an array of characters from the file, make sure it starts and ends with a space # Example input: "Hello World! " characters = np.array([' '] + list(open(sys.argv[1]).read()) + [' ']) # Result: array([' ', 'H', 'e', 'l', 'l', 'o', ' ', ' ', # 'W', 'o', 'r', 'l', 'd', '!', ' ', ' '], dtype=' 1] # Result: [array([' ', 'h', 'e', 'l', 'l', 'o'], dtype='