python类input()的实例源码

py3compat.py 文件源码 项目:leetcode 作者: thomasyimgit 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.input(prompt)
py3compat.py 文件源码 项目:leetcode 作者: thomasyimgit 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.raw_input(prompt)
py3compat.py 文件源码 项目:leetcode 作者: thomasyimgit 项目源码 文件源码 阅读 47 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.input(prompt)
py3compat.py 文件源码 项目:leetcode 作者: thomasyimgit 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.raw_input(prompt)
readline.py 文件源码 项目:pwndemo 作者: zh-explorer 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def init():
    # defer imports until initialization
    import sys, __builtin__
    from ..util import safeeval

    class Wrapper:
        def __init__(self, fd):
            self._fd = fd
        def readline(self, size = None):
            return readline(size)
        def __getattr__(self, k):
            return self._fd.__getattribute__(k)
    sys.stdin = Wrapper(sys.stdin)

    def raw_input(prompt = '', float = True):
        """raw_input(prompt = '', float = True)

        Replacement for the built-in `raw_input` using ``pwnlib``s readline
        implementation.

        Arguments:
            prompt(str): The prompt to show to the user.
            float(bool): If set to `True`, prompt and input will float to the
                         bottom of the screen when `term.term_mode` is enabled.
        """
        return readline(None, prompt, float)
    __builtin__.raw_input = raw_input

    def input(prompt = '', float = True):
        """input(prompt = '', float = True)

        Replacement for the built-in `input` using ``pwnlib``s readline
        implementation, and `pwnlib.util.safeeval.expr` instead of `eval` (!).

        Arguments:
            prompt(str): The prompt to show to the user.
            float(bool): If set to `True`, prompt and input will float to the
                         bottom of the screen when `term.term_mode` is enabled.
        """
        return safeeval.const(readline(None, prompt, float))
    __builtin__.input = input
sitecustomize.py 文件源码 项目:specto 作者: mrknow 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def input(prompt=''):
            #input must also be rebinded for using the new raw_input defined
            return eval(raw_input(prompt))
sitecustomize.py 文件源码 项目:specto 作者: mrknow 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def input(prompt=''):
            #the original input would only remove a trailing \n, so, at
            #this point if we had a \r\n the \r would remain (which is valid for eclipse)
            #so, let's remove the remaining \r which python didn't expect.
            ret = original_input(prompt)

            if ret.endswith('\r'):
                return ret[:-1]

            return ret
py3compat.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.input(prompt)
py3compat.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.raw_input(prompt)
py3compat.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.input(prompt)
py3compat.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.raw_input(prompt)
readline.py 文件源码 项目:black_zone 作者: zh-explorer 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def init():
    # defer imports until initialization
    import sys, __builtin__
    from ..util import safeeval

    class Wrapper:
        def __init__(self, fd):
            self._fd = fd
        def readline(self, size = None):
            return readline(size)
        def __getattr__(self, k):
            return self._fd.__getattribute__(k)
    sys.stdin = Wrapper(sys.stdin)

    def raw_input(prompt = '', float = True):
        """raw_input(prompt = '', float = True)

        Replacement for the built-in `raw_input` using ``pwnlib``s readline
        implementation.

        Arguments:
            prompt(str): The prompt to show to the user.
            float(bool): If set to `True`, prompt and input will float to the
                         bottom of the screen when `term.term_mode` is enabled.
        """
        return readline(None, prompt, float)
    __builtin__.raw_input = raw_input

    def input(prompt = '', float = True):
        """input(prompt = '', float = True)

        Replacement for the built-in `input` using ``pwnlib``s readline
        implementation, and `pwnlib.util.safeeval.expr` instead of `eval` (!).

        Arguments:
            prompt(str): The prompt to show to the user.
            float(bool): If set to `True`, prompt and input will float to the
                         bottom of the screen when `term.term_mode` is enabled.
        """
        return safeeval.const(readline(None, prompt, float))
    __builtin__.input = input
raw_input.py 文件源码 项目:blender 作者: gastrodia 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def raw_input(prompt=""):
    """raw_input([prompt]) -> string

Read a string from standard input.  The trailing newline is stripped.
If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.
On Unix, GNU readline is used if enabled.  The prompt string, if given,
is printed without a trailing newline before reading."""

    sys.stderr.flush()

    tty = STDIN.is_a_TTY() and STDOUT.is_a_TTY()

    if RETURN_UNICODE:
        if tty:
            line_bytes = readline(prompt)
            line = stdin_decode(line_bytes)
        else:
            line = stdio_readline(prompt)

    else:
        if tty:
            line = readline(prompt)
        else:
            line_unicode = stdio_readline(prompt)
            line = stdin_encode(line_unicode)

    if line:
        return line[:-1] # strip strailing "\n"
    else:
        raise EOFError
raw_input.py 文件源码 项目:blender 作者: gastrodia 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def input(prompt=""):
    """input([prompt]) -> value

Equivalent to eval(raw_input(prompt))."""

    string = stdin_decode(raw_input(prompt))

    caller_frame = sys._getframe(1)
    globals = caller_frame.f_globals
    locals = caller_frame.f_locals

    return eval(string, globals, locals)
raw_input.py 文件源码 项目:blender 作者: gastrodia 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def enable(return_unicode=RETURN_UNICODE):
    global RETURN_UNICODE
    RETURN_UNICODE = return_unicode

    builtins.raw_input = raw_input
    builtins.input = input
raw_input.py 文件源码 项目:blender 作者: gastrodia 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def disable():
    builtins.raw_input = original_raw_input
    builtins.input = original_input
py3compat.py 文件源码 项目:blender 作者: gastrodia 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.input(prompt)
py3compat.py 文件源码 项目:blender 作者: gastrodia 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.input(prompt)
py3compat.py 文件源码 项目:blender 作者: gastrodia 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.raw_input(prompt)
py3compat.py 文件源码 项目:yatta_reader 作者: sound88 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.input(prompt)
py3compat.py 文件源码 项目:yatta_reader 作者: sound88 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.raw_input(prompt)
py3compat.py 文件源码 项目:yatta_reader 作者: sound88 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.input(prompt)
py3compat.py 文件源码 项目:yatta_reader 作者: sound88 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def input(prompt=''):
        return builtin_mod.raw_input(prompt)


问题


面经


文章

微信
公众号

扫码关注公众号