Login

Please fill in your details to login.





registration (simple version)

Very simple user registration system in Python.
A very simple registration script. It asks you for a username, checks whether the username already exists in the users.csv file before asking you for a password and 'registering' you (by storing your username and password). Simples.

import csv
USERSFILE = 'users.csv'

users = csv.csv2sequence(USERSFILE)

valid = False
while not valid:
  username  = input('Select username            : ')
  clash = False
  for user in users:
    if username == user[0]:
      print('Username already in use - try again')
      clash = True
  if not clash:
    password = input('Set a password             : ')
    users.append([username,password])
    csv.sequence2csv(users,USERSFILE)
    valid = True


I've provide you with this script, a csv handling library (mine, not Pythons) and a sample users.csv file.

Catalogue

All third party documentation is provided purely for educational purposes and must not be distributed. If you are the copyright owner of these documents and you do not with me to make them available here, please get in touch.
filetype
1.1 KiB
filetype
471.0 B
filetype
88.0 B
Last modified: February 26th, 2022
The Computing Café works best in landscape mode.
Rotate your device.
Dismiss Warning