Created
March 21, 2012 23:15
-
-
Save gsora/2154038 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python2 | |
| #-*- coding:utf-8 -*- | |
| import os | |
| import commands | |
| import hashlib | |
| # Menu! | |
| def menu(): | |
| print '|--------------------------------------|' | |
| print '|---#####--- School tracker ---#####---|' | |
| print '|--------------------------------------|' | |
| print '' | |
| print 'Loggato come: %s' % (loggeduser) | |
| print '' | |
| print '1 - elenco materie nel database' | |
| print '2 - aggiungi materia al database' | |
| print '3 - media attuale' | |
| print '4 - aggiungi voto' | |
| print '' | |
| scelta = input('Cosa vuoi fare? Inserisci il numero corrispondente alla tua scelta. ') | |
| return | |
| ######################################################################### | |
| #login statement | |
| username = raw_input('Username? ') | |
| password = raw_input('Password? ') | |
| #implementazione di hashlib, più o meno corretta ma almeno funziona! | |
| h = hashlib.md5('md5') | |
| h.update(password) | |
| passtotest = h.hexdigest() | |
| ######################## | |
| ######### TO DO ######### | |
| # LOGIN PART!!!!!! | |
| # Molto importante è la login part, in cui si utilizzerà la variabile "loginwentgood" per definire "loggeduser". | |
| # La password DEVE essere salvata in un database sqlite | |
| # To do: | |
| # - login via sqlite | |
| # - creazione di un nuovo utente | |
| ######################### | |
| loginwentgood = 'true' | |
| if loginwentgood == 'true': | |
| loggeduser = username | |
| menu() | |
| else: | |
| print 'Login errato!' | |
| exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment