python Hiding raw_input
Question: so this is my code and i want to hide my password, but i dont know how. i have
looked around and none of them seem to fit in my coding, this is the current
coding. i mean i have seen show="*" and also getpass but i dont know how to
place them into this coding. im using python 2.7.3 and im coding on a
raspberry pi.

    
    
    ans = True
    
    while ans:
        print("""
                       -------------
                      | 1. Shutdown | 
                      | 2. Items    |
                       -------------
        """)
    
        ans=raw_input("""
    
                 Please Enter A Number: """)
    
        if ans == "1":
    
            exit()
        elif ans == "2":
    
    
            pa=raw_input("""
    
                 Please Enter Password: """)
    
            if pa == "zombiekiller":
    
                print("""
                       ----------------
                      | 1. Pi password |
                      | 2. Shutdown    |
                       ----------------
                """)
    
                pe=raw_input ("""
    
                 Please Enter A Number: """)
    
                if pe == "1":
                    print ("""
    
                 Pi's Password Is Adminofpi""")
                    import time
                    time.sleep(1)
                    exit()
    
                elif pe == "2":
                    exit()
    
                else:
                    print("""
    
                 You Have Entered An Inccoredt Option. Terminating Programm""")
                    import time
                    time.sleep(1)
                    exit()
    
            else:
                    print("""
    
                 You Have Entered An Inccorect Password. Terminating Programm""")
                    import time
                    time.sleep(1)
                    exit()
    


Answer: `getpass` hides the input, just replace `raw_input` after importing the module
`getpass`, like this:

    
    
    import getpass
    .
    .
    .
    pa = getpass.getpass()
    

