示例#1
0
def enterbox(msg="Enter something.", title=" ", default="",
             strip=True, image=None, root=None):
    """
    Show a box in which a user can enter some text.

    You may optionally specify some default text, which will appear in the
    enterbox when it is displayed.

    Example::

        reply = enterbox(....)
        if reply:
            ...
        else:
            ...

    :param str msg: the msg to be displayed.
    :param str title: the window title
    :param str default: value returned if user does not change it
    :param bool strip: If True, the return value will have
      its whitespace stripped before being returned
    :return: the text that the user entered, or None if he cancels
      the operation.
    """
    result = __fillablebox(
        msg, title, default=default, mask=None, image=image, root=root)
    if result and strip:
        result = result.strip()
    return result
示例#2
0
def passwordbox(msg="Enter your password.", title=" ", default="",
                image=None, root=None):
    """
    Show a box in which a user can enter a password.
    The text is masked with asterisks, so the password is not displayed.

    :param str msg: the msg to be displayed.
    :param str title: the window title
    :param str default: value returned if user does not change it
    :return: the text that the user entered, or None if he cancels
      the operation.
    """
    return __fillablebox(msg, title, default, mask="*",
                         image=image, root=root)
示例#3
0
def passwordbox(msg="Enter your password.",
                title=" ",
                default="",
                image=None,
                root=None):
    """
    Show a box in which a user can enter a password.
    The text is masked with asterisks, so the password is not displayed.

    :param str msg: the msg to be displayed.
    :param str title: the window title
    :param str default: value returned if user does not change it
    :return: the text that the user entered, or None if they cancel
      the operation.
    """
    return __fillablebox(msg, title, default, mask="*", image=image, root=root)
示例#4
0
def enterbox(msg="Enter something.",
             title=" ",
             default="",
             strip=True,
             image=None,
             root=None):
    """
    Show a box in which a user can enter some text.

    You may optionally specify some default text, which will appear in the
    enterbox when it is displayed.

    Example::

        import easygui
        reply = easygui.enterbox('Enter your life story:')
        if reply:
            easygui.msgbox('Thank you for your response.')
        else:
            easygui.msgbox('Your response has been discarded.')

    :param str msg: the msg to be displayed.
    :param str title: the window title
    :param str default: value returned if user does not change it
    :param bool strip: If True, the return value will have
      its whitespace stripped before being returned
    :return: the text that the user entered, or None if they cancel
      the operation.
    """
    result = __fillablebox(msg,
                           title,
                           default=default,
                           mask=None,
                           image=image,
                           root=root)
    if result and strip:
        result = result.strip()
    return result
示例#5
0
def enterbox(msg="Enter something.",
             title=" ",
             default="",
             strip=True,
             image=None,
             root=None):
    """
    Show a box in which a user can enter some text.

    You may optionally specify some default text, which will appear in the
    enterbox when it is displayed.

    Example::

        reply = enterbox(....)
        if reply:
            ...
        else:
            ...

    :param str msg: the msg to be displayed.
    :param str title: the window title
    :param str default: value returned if user does not change it
    :param bool strip: If True, the return value will have
      its whitespace stripped before being returned
    :return: the text that the user entered, or None if he cancels
      the operation.
    """
    result = __fillablebox(msg,
                           title,
                           default=default,
                           mask=None,
                           image=image,
                           root=root)
    if result and strip:
        result = result.strip()
    return result