Once i have logged password + username...

This is the place for queries that don't fit in any of the other categories.

Once i have logged password + username...

Postby Im Anonymous » Sun Jun 09, 2013 8:11 am

Once i have logged my first name + last name + password how can i create something that allows me to log in using these details (only if first name + last name + password are correct) so basically i run my script and it asks for your first name and then last name, it will then ask you to create a password. I want to make it so that you can skip this stage if you have already done it before and log in with the details you have already typed in (that have been logged and saved in getpass.log folder)

Code: Select all
import logging
enter = ("")
print ("Press 'Enter' to continue...")
input (enter)
first_name = input("Please type your first name: ")
last_name = input("Okay "+first_name+" please type your last name: ")
input (enter)
while True:
    pass1 = input("Please create a password: ")
    pass2 = input("Please retype your password: ")
    if pass1 == pass2:
        log = logging.getLogger('getpass')
        formatter = logging.Formatter('[%(levelname)s] %(message)s')
        handler = logging.FileHandler('getpass.log')
        log.info("PASSWORD: " +pass1)
        log.info("FIRST NAME: "+first_name)
        log.info("LAST NAME: "+last_name)
        input (enter)
        print ("Your information has been stored")
        input (enter)
        print ("Sorry "+first_name+" "+last_name+" your passwords did not match")
        print ("Please press 'Enter' to try again")
        input (enter)
Im Anonymous
Posts: 9
Joined: Fri Jun 07, 2013 1:29 am

Re: Once i have logged password + username...

Postby metulburr » Sun Jun 09, 2013 8:25 am

Im not sure why you are using logging to store and attempt to retrieve your data?
Try using the shelve module if your just messing around with it.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
User avatar
Posts: 1384
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot], W3C [Linkcheck] and 1 guest