#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    california
    Posts
    53
    Rep Power
    10

    Problem with getpass module


    ok i have a quick question i was wondering how to get the password for a user name like:

    import getpass
    getpass.getuser()



    that gives me the user name but i want the password. soo what will i plug in for prompt>>

    import getpass
    getpass.getpass([prompt])
  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    Hi miryln,

    getpass is not a tool for managing system passwords

    The getpass module is platform independent way of getting the user to type a string without displaying the actual characters on the screen. Finding out what username owns the process that the python script is running in is the only other thing it does.

    Code:
    secret = getpass.getpass("Please type your secret code here: ")
    It is up to you how the "password" is used.

    grim

    Comments on this post

    • miryln agrees : ok
    Last edited by Grim Archon; February 24th, 2006 at 03:28 AM.
  4. #3
  5. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    Last edited by Grim Archon; February 24th, 2006 at 04:59 AM.
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Originally Posted by Grim Archon
    What so comfused about grim?

    Mark.
    programming language development: www.netytan.com – Hula

  8. #5
  9. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    Originally Posted by netytan
    What so comfused about grim?

    Mark.
    Wierd stuff I made two posts in this thread and there was a big pause (30+ secs) while the page refreshed back to the thread list but devshed did not update the reply count from 0. Yet I could list the replies and view them.

    Looks like its all sorted now


    grim
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    california
    Posts
    53
    Rep Power
    10
    ok I get yah soo how do i get a password from a user name?? is it too complicated to explain?
  12. #7
  13. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    That would depend on the system you're running under and what you want to do but is likely more trouble than it's worth. Why not store you're own set of passwords for the app?

    Passwords on *nix are stored in an encrypted form in a protected file.

    Mark.

    Comments on this post

    • miryln agrees : interesting
    programming language development: www.netytan.com – Hula

  14. #8
  15. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    IIRC, Windows logon passwords are stored in encrypted (?) .cab files.
  16. #9
  17. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Originally Posted by †Yegg†
    IIRC, Windows logon passwords are stored in encrypted (?) .cab files.
    They may be but I was refering to system passwords.
    programming language development: www.netytan.com – Hula

  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    california
    Posts
    53
    Rep Power
    10
    and what is the *nix?
  20. #11
  21. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    Originally Posted by miryln
    and what is the *nix?
    *nix refers to Linux or Unix OS's.
    The asterick (*) is a wildcard.
  22. #12
  23. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Originally Posted by miryln
    and what is the *nix?
    Oh boy, *nix is Unix Linux BSD etc. operating systems that actually have security .

    Mark.
    programming language development: www.netytan.com – Hula

  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2006
    Posts
    69
    Rep Power
    9
    typically this is what I have been doing:

    useraccount = raw_input("Username:")
    userpassword = getpass.getpass("Password:")


    Username will be visable, password will be non-visable..

    Comments on this post

    • miryln agrees : alrighty
  26. #14
  27. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    california
    Posts
    53
    Rep Power
    10
    oh thats a good idea ill try it out.

IMN logo majestic logo threadwatch logo seochat tools logo