python文本编辑器YAPE(2)
保存功能
使用Textbox的gather()方法得到文本,写到文件中。
import curses
import curses.textpad as tb
stdscr = curses.initscr()
curses.noecho()
editor=tb.Textbox(stdscr)
content=''
try:
editor.edit()
except KeyboardInterrupt:
content=editor.gather()
f=open('./text.txt','w')
f.write(content)
f.close()
curses.endwin()
貌似命令行参数那少了一个逗号。。。。。。。。。
无耳卯小孓 无耳卯小摘自 无耳卯小孓
补充:Web开发 , Python ,