• <small id='vWbV3'></small><noframes id='vWbV3'>

  • <legend id='vWbV3'><style id='vWbV3'><dir id='vWbV3'><q id='vWbV3'></q></dir></style></legend>

    <tfoot id='vWbV3'></tfoot>
      <bdo id='vWbV3'></bdo><ul id='vWbV3'></ul>
    <i id='vWbV3'><tr id='vWbV3'><dt id='vWbV3'><q id='vWbV3'><span id='vWbV3'><b id='vWbV3'><form id='vWbV3'><ins id='vWbV3'></ins><ul id='vWbV3'></ul><sub id='vWbV3'></sub></form><legend id='vWbV3'></legend><bdo id='vWbV3'><pre id='vWbV3'><center id='vWbV3'></center></pre></bdo></b><th id='vWbV3'></th></span></q></dt></tr></i><div id='vWbV3'><tfoot id='vWbV3'></tfoot><dl id='vWbV3'><fieldset id='vWbV3'></fieldset></dl></div>

        获取隐藏密码输入

        Getting a hidden password input(获取隐藏密码输入)
      1. <tfoot id='vfhNt'></tfoot>

          <legend id='vfhNt'><style id='vfhNt'><dir id='vfhNt'><q id='vfhNt'></q></dir></style></legend>

              • <i id='vfhNt'><tr id='vfhNt'><dt id='vfhNt'><q id='vfhNt'><span id='vfhNt'><b id='vfhNt'><form id='vfhNt'><ins id='vfhNt'></ins><ul id='vfhNt'></ul><sub id='vfhNt'></sub></form><legend id='vfhNt'></legend><bdo id='vfhNt'><pre id='vfhNt'><center id='vfhNt'></center></pre></bdo></b><th id='vfhNt'></th></span></q></dt></tr></i><div id='vfhNt'><tfoot id='vfhNt'></tfoot><dl id='vfhNt'><fieldset id='vfhNt'></fieldset></dl></div>

                  <tbody id='vfhNt'></tbody>

                <small id='vfhNt'></small><noframes id='vfhNt'>

                  <bdo id='vfhNt'></bdo><ul id='vfhNt'></ul>
                  本文介绍了获取隐藏密码输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  您知道在 Linux 中,当您尝试一些 Sudo 内容时,它会告诉您输入密码,而当您键入时,终端窗口中没有显示任何内容(未显示密码)?

                  You know how in Linux when you try some Sudo stuff it tells you to enter the password and, as you type, nothing is shown in the terminal window (the password is not shown)?

                  有没有办法在 Python 中做到这一点?我正在编写一个需要如此敏感信息的脚本,并希望在我输入时将其隐藏.

                  Is there a way to do that in Python? I'm working on a script that requires so sensitive info and would like for it to be hidden when I'm typing it.

                  换句话说,我想在不显示密码的情况下从用户那里获取密码.

                  In other words, I want to get the password from the user without showing the password.

                  推荐答案

                  使用<代码>getpass.getpass():

                  from getpass import getpass
                  password = getpass()
                  

                  一个可选的提示可以作为参数传递;默认为 密码:".

                  An optional prompt can be passed as parameter; the default is "Password: ".

                  请注意,此功能需要正确的终端,因此它可以关闭输入字符的回显 - 请参阅 GetPassWarning: Can not control echo on the terminal"从 IDLE 运行时了解更多详情.

                  Note that this function requires a proper terminal, so it can turn off echoing of typed characters – see "GetPassWarning: Can not control echo on the terminal" when running from IDLE for further details.

                  这篇关于获取隐藏密码输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)
                    <tbody id='9NXRl'></tbody>

                    1. <i id='9NXRl'><tr id='9NXRl'><dt id='9NXRl'><q id='9NXRl'><span id='9NXRl'><b id='9NXRl'><form id='9NXRl'><ins id='9NXRl'></ins><ul id='9NXRl'></ul><sub id='9NXRl'></sub></form><legend id='9NXRl'></legend><bdo id='9NXRl'><pre id='9NXRl'><center id='9NXRl'></center></pre></bdo></b><th id='9NXRl'></th></span></q></dt></tr></i><div id='9NXRl'><tfoot id='9NXRl'></tfoot><dl id='9NXRl'><fieldset id='9NXRl'></fieldset></dl></div>

                      • <tfoot id='9NXRl'></tfoot>
                        <legend id='9NXRl'><style id='9NXRl'><dir id='9NXRl'><q id='9NXRl'></q></dir></style></legend>
                      • <small id='9NXRl'></small><noframes id='9NXRl'>

                            <bdo id='9NXRl'></bdo><ul id='9NXRl'></ul>