def save_as(): global file_name content = content_text.get(1.0, 'end') with open(file_name, 'w') as save: save.write(content)