window.py 文件源码

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

项目:cursed 作者: johannestaas 项目源码 文件源码
def getstr(cls, x=None, y=None, prompt=None):
        '''
        Get string input from user at position, with optional prompt message.

        :param x: optional x value
        :param y: optional y value
        :param prompt: message to prompt user with, example: "Name: "
        :return: the string the user input
        '''
        x, y = cls._fix_xy(x, y)
        if prompt is not None:
            cls.WINDOW.addstr(y, x, prompt)
            x += len(prompt)
        curses.echo()
        s = cls.WINDOW.getstr(y, x)
        curses.noecho()
        return s.decode('utf-8')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号