Skip to content

Instantly share code, notes, and snippets.

@lmaresz
Created October 26, 2014 19:20
Show Gist options
  • Save lmaresz/275065956339a465c165 to your computer and use it in GitHub Desktop.
Save lmaresz/275065956339a465c165 to your computer and use it in GitHub Desktop.
enaplo
import msvcrt
import re
def login ():
print ("Bejelentkezés...")
def strcheck1 (string):
if re.match ('^[a-z0-9]{8}$',string) != None:
return True
else:
return False
def strcheck2 (string):
if re.match ("")
def reg():
print ("Üdvözöllek a regisztrációs oldalon")
#print ("Kilépéshez nyomd meg a 0-t, folytatáshoz bármit!")
#valasz = input()
#if int(valasz) == 0:
# return None
danet_reg = danet_read ()
if danet_reg != False:
print ("A {0} kódszámú diák sikeresen regisztrálva!".format(danet_reg))
else:
print ("Hiba lépett fel a regiszráció során, a program visszatér a főmenübe!")
name_reg = name_read ()
def FileOpen ():
f = open('danet.txt', 'r')
danet = f.readlines()
for i in range(len(danet)):
danet[i] = danet[i].rstrip("\n")
return danet
f.close()
def danet_read ():
code = input("Add meg a DANET kódot: ")
if strcheck (code):
for i in danet:
if code == i:
print ("ERROR egyezés!")
return False
else:
print ("ERROR bad syntax")
return False
return code
def name_read ():
name = input ("Add meg a teljes nevet:")
strcheck2
def MainMenu(lista):
a = 0
for i in range (len(cim)):
print ("%d.%s" %(a,lista[0][i]))
a = a+1
valasz = int(input ("Add meg a menüpont számát:"))
eval (lista[1][valasz])
############################MAIN PROGRAM##################################
danet = []
parancs = ["reg()","user_del()","login()"]
cim = ["Regisztráció", "Felhasználó törlése", "Bejelentkezés"]
lista = [cim, parancs]
danet = FileOpen ()
while True:
MainMenu (lista)
FileOpen ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment