TextEditor.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:HTP 作者: nklose 项目源码 文件源码
def start_editor(self):
        try:
            # draw the top bar
            top_bar = 'Editing ' + self.file.name + ' [press Ctrl+G to save and close]'
            i = len(top_bar)
            while i < self.scr_width:
                top_bar += ' '
                i += 1
            self.scr.addstr(0, 0, top_bar, curses.A_REVERSE)
            self.scr.refresh()

            # let the user edit th efile
            box = Textbox(self.text_win)
            box.edit()

            # get the file contents
            self.file_text = box.gather()
        finally:
            # return to the game
            curses.endwin()
            gc.clear()
            self.file.content = self.file_text
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号