import curses import io stdscr = curses.initscr() window = stdscr.subwin(50,50,0,0) window.box() window.refresh() window.addstr(2,10,"Hello, HiroPEditor") window.refresh() mystr = window.getstr(10,10) #window.addstr(10,5, mystr) file_open = open("./file.txt", "w") str = mystr.decode() window.addstr(15,20, mystr) try: file_open.write(str) file_open.write("\n") finally: file_open.close() window.refresh()