Skip to content

Note

Click here to download the full example code

Password login#

A password login field widget.

login

Out:

<FunctionGui login(username: str = '', password: str = '', password2: str = '')>


from magicgui import magicgui


# note that "password" is a special keyword argument
# it will create a password field in the gui by default
# (unless you override "widget_type")
# whereas "password2" will be a normal text field
# (unless you override "widget_type")
@magicgui(password2={"widget_type": "Password"})
def login(username: str, password: str, password2: str):
    """User login credentials."""
    ...


login.show(run=True)

Total running time of the script: ( 0 minutes 0.033 seconds)

Download Python source code: login.py

Download Jupyter notebook: login.ipynb

Gallery generated by mkdocs-gallery