Need help with a error in my code, that i cannot see for my self! sorry as it may be me being stupid
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
El punto de entrada relevante es find_username1() en el script proporcionado; compara su búsqueda con register_user(), que escribe el nombre de usuario, la contraseña y el correo electrónico en archivos cuyos nombres corresponden al nombre de usuario. Ejecuta el flujo de recuperación del nombre de usuario con una cuenta registrada y consigue que el comportamiento completado identifique el nombre de usuario asociado al correo electrónico introducido.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
So, i have been making my own login system, and saving it to a txt file. i have completed the basic's nearly, Login, Register, and now i am trying to add a forget password and username functions. so basically i have a if statement that checks if the user name is in one of the files. and then sends a recovery code. well for this case its a var assigned to randint(1000,9999) thats to reset the password. then i thought what if the user forgets there username, well you get them to insert there email they signed up with and if it matches a account(in one of the saved files) it sends a code to that email(console). Reset password works fine, but trying to find the players username is hard one, im not directly trying to match the email with the username, im trying to read the file for a email that matches one that is saved. and then will pull there username after, but i havent got that far yet, as when i enter a email its not finding it, instead its finding the username, could somone please help. it could be a small error i cannot see because its so late, and im so tired, but any help would be much appreciated thx.
`import tkinter
from tkinter import*
import os
import random
from random import randint
def register_user():
username_info = username.get()
password_info = password.get()
email_info = email.get()
file=open(username_info, 'w')
file.write(username_info+'\n')
file.write(password_info+'\n')
file.write(email_info)
file.close()
username_entry.delete(0, END)
password_entry.delete(0, END)
email_entry.delete(0, END)
Label(screen1, text = 'Registration susccesful', fg = 'green', font = ('calibri', 11)).pack()
def login_verify():
username1 = username_verify.get()
password1 = password_verify.get()
username_entry1.delete(0, END)
password_entry1.delete(0, END)
list_of_files = os.listdir()
if username1 in list_of_files:
file1 = open(username1, 'r')
verify = file1.read().splitlines()
if password1 in verify:
print('Login Sucess')
else:
print('password incorrect')
else:
print('username incorrect')
def codeS():
global code
code = randint(1000, 9999)
def submit_code():
code1 = code_verify.get()
password_code.delete(0, END)
if int(code1) == code:
Label(screen4, text='Code Correct', bg='green').pack()
else:
Label(screen4, text='Wrong Code', bg='red').pack()
def change_password():
global code_verify
global password_code
code_verify = StringVar()
username2 = username_verify2.get()
username_entry2.delete(0, END)
list_of_files = os.listdir()
if username2 in list_of_files:
file2 = open(username2, 'r')
verify1 = file2.read().splitlines()
codeS()
print(code)
Label(screen4, text='Reset Code Sent').pack()
password_code = Entry(screen4, textvariable = code_verify)
password_code.pack()
Label(screen4, text='').pack()
Button(screen4, text='Submit Code', width = 10, height = 2, command=submit_code).pack()
else:
Label(screen4, text='').pack()
Label(screen4, text='No matching user name').pack()
def find_username1():
global code_verify2
global username_code
code_verify2 = StringVar()
email2 = email_verify1.get()
email_entry1.delete(0, END)
list_of_files = os.listdir()
if email2 in list_of_files:
file3 = open(email2, 'r')
verify3 = file3.read().splitlines()
print('found')
else:
Label(screen5, text='').pack()
Label(screen5, text='No matching email').pack()
def register():
global screen1
screen1 = Toplevel(screen)
screen1.title('Register')
screen1.geometry('300x250')
global username
global password
global email
global username_entry
global password_entry
global email_entry
username = StringVar()
password = StringVar()
email = StringVar()
Label(screen1, text = 'Please enter details bellow').pack()
Label(screen1, text = '').pack()
Label(screen1, text = 'Username *').pack()
username_entry = Entry(screen1, textvariable = username)
username_entry.pack()
Label(screen1, text = 'Password *').pack()
password_entry = Entry(screen1, textvariable = password)
password_entry.pack()
Label(screen1, text = 'Email *').pack()
email_entry = Entry(screen1, textvariable = email)
email_entry.pack()
Label(screen1, text = '').pack()
Button(screen1, text = 'Register', width = 10, height = 1, command = register_user).pack()
def reset_password():
global screen4
screen4 = Toplevel(screen)
screen4.title('Reset Password')
screen4.geometry('300x250')
Label(screen4, text='Enter username *', height = 2, width = 30).pack()
global username_entry2
global username_verify2
username_verify2 = StringVar()
username_entry2 = Entry(screen4, textvariable = username_verify2)
username_entry2.pack()
Label(screen4, text='').pack()
Button(screen4, text='Reset Password', command=change_password).pack()
def forgot_user():
global screen5
screen5 = Toplevel(screen)
screen5.title('Find Username')
screen5.geometry('300x250')
Label(screen5, text='Enter Email *', height=2, width=30).pack()
global email_entry1
global email_verify1
email_verify1 = StringVar()
email_entry1 = Entry(screen5, textvariable = email_verify1, width=30)
email_entry1.pack()
Label(screen5, text='').pack()
Button(screen5, text='Find Username', command=find_username1).pack()
def login_issue():
global screen3
screen3 = Toplevel(screen)
screen3.title('Login Issues')
screen3.geometry('350x250')
Label(screen3, text='Have you forgot your username or password?', bg = 'grey', width = '350', height = '2', font = ('Calibri', 13)).pack()
Label(screen3, text = '').pack()
Button(screen3, text = 'Username', width = 30, height = 2, command = forgot_user).pack()
Label(screen3, text = '').pack()
Button(screen3, text = 'Password', width = 30, height = 2, command = reset_password).pack()
def login():
global screen2
screen2 = Toplevel(screen)
screen2.title('Login')
screen2.geometry('300x250')
Label(screen2, text = 'Please enter details bellow to login').pack()
Label(screen2, text = '').pack()
global username_verify
global password_verify
username_verify = StringVar()
password_verify = StringVar()
global username_entry1
global password_entry1
Label(screen2, text = 'Username * ').pack()
username_entry1 = Entry(screen2, textvariable = username_verify)
username_entry1.pack()
Label(screen2, text = '').pack()
Label(screen2, text = 'Password * ').pack()
password_entry1 = Entry(screen2, textvariable = password_verify)
password_entry1.pack()
Label(screen2, text = '').pack()
Button(screen2, text = 'Login', width = 10, height = 1, command = login_verify).pack()
Label(screen2, text = '').pack()
Button(screen2, text = 'Login issue?', width = 10, height = 1, command=login_issue).pack()
def main_screen():
global screen
screen = Tk()
screen.geometry('300x250')
screen.title('Login API 1.2')
Label(text = 'Login 1.2', bg = 'grey', width = '300', height = '2', font = ('Calibri', 13)).pack()
Label(text = '').pack()
Button(text = 'Login', height = '2', width = '30', command=login).pack()
Label(text = '').pack()
Button(text = 'Register', height = '2', width = '30', command=register).pack()
screen.mainloop()
main_screen()
`
- Lenguaje dominante
- Python
- Estrellas
- 35.4k
- Forks
- 12.9k
- Merge medio
- 2 h 37 min
- PR fusionados (30 d)
- 1
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de geekcomputers/Python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
geekcomputers/Python#3205 · 2 comentarios ·
-
Add number_guesse.py feature Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
geekcomputers/Python#3188 · 3 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
geekcomputers/Python#3060 · 1 comentario ·
-
[BUG] shapchat Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
geekcomputers/Python#3214 · 5 comentarios ·
-
Test of an Issue Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
geekcomputers/Python#3209 · 5 comentarios ·
Todos los issues de geekcomputers/Python
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
zostera/django-bootstrap4#894 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
use-agent-os/agent-os#3276 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NousResearch/hermes-agent#117848 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
zilliztech/memsearch#759 ·