def solve_and_print_results(equations, exelist, results_list):
    """
    creates temporary python file to execute solving in it's own environment
    tmp python file records the results output to a tmp text file
    the output text file is send back to the user
    """
    pyfile = open('tmp.py', 'w')
    librarylist = ['']
    for i in librarylist:
        pyfile.write(i + '\n')
    for i in exelist:
        pyfile.write(str(i) + '\n')
    results = ['textfile = open("tmp.txt", "w")',
        'textfile.write("Entered Equations: \\n\\n")', 'for i in' + str(
        equations) + ': ', '    textfile.write(i + "\\n")',
        'textfile.write("\\nResults: \\n\\n")']
    for i in results:
        pyfile.write(i + '\n')
    for i in results_list:
        pyfile.write('print("' + i + ' = " + str(float(' + i +
            ')), file=textfile)\n')
    pyfile.write('textfile.close()\n')
    pyfile.close()
    import os
    os.system('python tmp.py')
    with open('tmp.txt', mode='r') as f:
        line_list = []
        while True:
            line = f.readline()
            if len(line) == 0:
                break
            line_list.append(line)
    outstring = ''.join(list(filter(None, line_list)))
    return outstring
