<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 問題 You’ve written a script that requires a password, but since the script is meant for inter‐active use, you’d like to prompt the user for a password rather than hardcode it into thescript. ## 解決方案 Python’s getpass module is precisely what you need in this situation. It will allow youto very easily prompt for a password without having the keyed-in password displayedon the user’s terminal. Here’s how it’s done: import getpass user = getpass.getuser()passwd = getpass.getpass() if svc_login(user, passwd): # You must write svc_login()print(‘Yay!')else:print(‘Boo!') In this code, the svc_login() function is code that you must write to further processthe password entry. Obviously, the exact handling is application-specific. ## 討論 Note in the preceding code that getpass.getuser() doesn’t prompt the user for theirusername. Instead, it uses the current user’s login name, according to the user’s shellenvironment, or as a last resort, according to the local system’s password database (onplatforms that support the pwd module). If you want to explicitly prompt the user for their username, which can be more reliable,use the built-in input function: user = input(‘Enter your username: ‘) It’s also important to remember that some systems may not support the hiding of thetyped password input to the getpass() method. In this case, Python does all it can toforewarn you of problems (i.e., it alerts you that passwords will be shown in cleartext)before moving on.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看