def save_function(code): function = open('output.py', 'w') function.write(code) function.close()