0

I am using ipywidgets to create text boxes as described in the documentation. That works fine, but I want to create text boxes which show just dots/stars/whatever when an user gives some input, like for a password input box.

Is that possible to do with ipywidgets, and if so, how? The documentation is a bit scarce I would say...

Alex
  • 41,580
  • 88
  • 260
  • 469

1 Answers1

4

It appears to be missing in the documentation, but it does exist, we'll need to fix that.

import ipywidgets
password_widget = ipywidgets.Password(description='Password:', placeholder='Make it long!')
password_widget

In another cell, you can print out it's value:

password_widget.value
Maarten Breddels
  • 1,344
  • 10
  • 12
  • Just as an FYI - the passwords in the most recent version of ipywidgets are off - the Input style attributes in the default CSS only apply to Inputs with a type of 'text'. If the Input has a type of 'password' instead, and is right next to another Input of the ordinary ipywidgets.Text() class (for something that should be displayed, such as a username) then the two will look different compared to each other. – wanderso Nov 12 '19 at 20:36