I have an IPython notebook which accesses data via SSH using encrypted ssh key file. I don't want to store the password in the notebook (nor in a separate file). I can use input
in order to read the password from user prompt, but in this case the password is visible on the screen. Is there a way to securely obtaining password?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
You should import the
getpass
module, then callgetpass.getpass
.Note that in old versions, the field where you enter the password may not appear in the IPython Notebook, but instead in your terminal/command prompt window. In the latest versions of Jupyter Notebook, however, the prompt will appear in the Notebook itself.