Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import re
- q_user = r'([\d\w]{3,})\,([\d\w]{3,})\n'
- q_name = r'(name)\,([\d\w]{3,})\n'
- q_password = r'([\d\w]{3,})\,(password)\n'
- print 'Welcome to our Autorization Service!'
- menu = input('Print 1 for registration or 2 for login')
- if not os.path.isfile('users'):
- open('users', 'w').close()
- f = open('users', 'a')
- def name_exists(name):
- users = f.read()
- r = re.search(q_name.replace('name', name), users)
- return r
- if menu == '1':
- print 'Registration!\n*****')
- name = input('Your name: ')
- pass_success = False
- while not pass_success:
- password = input('Your password: ')
- if input('Repeat password: ') == password:
- pass_success = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement