0
Line10 is not definded
In trouble
6 Réponses
+ 1
Its supposed to be
string.punctuation instead of
string_ponctuation
+ 1
Put
global password_entry
as the first line of the function
0
import string
from random import randint,choice
from tkinter import *
def gerate_password():
password_min=6
password_max=12
all_chars=string.ascii_letters+ string_ponctuation+ string.digits
password="".join(choice(all_chars)for x in range(randint(password_min,password_max))
password_entry.delete(0, END)
password_entry.insert(0, password)
window= Tk()
window.title("generateur de mp")
window.geometry("720x480")
window.config(background='#ffAf00')
right_frame=Frame(window, bg='#ffAf00')
label_title=Label(right_frame, text='mot de passe', font=("helvetica",10), bg='#ffAf00', fg='white')
label_title.pack()
password_entry=Entry(right_frame, font=("helvetica",20), bg='#ffAf00', fg='white')
password_entry.pack()
generate_password_button=Button(right_frame, text='generate', font=("helvetica",10), bg='#ffAf00', fg='white', comand=generate_password)
generate_password_button.pack()
right_frame.grid(row=0, column=1, sticky=W)
right_frame.pack(expand=YES)
menu_bar= Menu(menu_bar,tearoff=0)
file_menu.add_comand(l
0
Here's the problem:
Password_entry.delete(0,END)
Password_entry.insert(0,END)
So it's seeing Password_entry is not definded
0
Invalid syntax......?
0
You can copy and then rewrite the code