basic text editor written in python