def get_params(fname, desired_command):
    with open(fname, 'r') as f:
        content = f.read()
for element in content.split('$'):
    element = element.replace('\n', ' ').strip()
if not element:
    continue
if ' ' in element:
    command, result = element.split(' ', 1)
else:
    pass
Read and parse a file of tokens?