@ -6,12 +6,12 @@ lst_ALPHABET = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
lst_chiffres = [ ' 0 ' , ' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' ]
lst_special = [ ' & ' , ' à ' , ' ç ' , ' _ ' , ' - ' , ' è ' , ' é ' , ' * ' , ' § ' , ' @ ' , ' µ ' , ' ^ ' , ' ¨ ' , ' $ ' , ' £ ' , ' = ' , ' . ' , ' œ ' ]
def generer_mdp ( ) :
def generer_mdp ( ) : #fonction de generation des mdps
global chaine
l_mdp = int ( value1 . get ( ) )
nbr_maj = int ( value2 . get ( ) )
nbr_chiffres = int ( value3 . get ( ) )
nbr_special = int ( value4 . get ( ) )
global chaine
mdp = [ ]
if nbr_maj + nbr_chiffres + nbr_special < = l_mdp :
@ -39,77 +39,104 @@ def generer_mdp():
chaine = " impossible "
mdp_label . set ( chaine )
def copie ( ) :
def copie ( ) : #fonction copier coller dans le presse papier
global chaine
#fonction copier
fenetre . clipboard_clear ( )
fenetre . clipboard_append ( chaine )
bg_color = " #8cc2e6 "
bg_active_color = " #8cc2e6 "
fg_color = " #ec5c33 "
fg_active_color = " #ec5c33 "
str_color = " white "
str_active_color = " white "
w_elem = 25
w_entry = 30
fenetre = Tk ( )
fenetre . configure ( bg = " yellow " )
fenetre . configure ( bg = bg_color )
chaine = " aucun "
""" """
""" labels mdp """
mdp_est = StringVar ( )
mdp_est . set ( " Le mot de passe est : " )
label_mdp_est = Label ( fenetre , textvariable = mdp_est )
label_mdp_est = Label ( fenetre , textvariable = mdp_est , bg = fg_color , fg = str_color , width = w_elem )
label_mdp_est . grid ( row = 9 , column = 0 )
mdp_label = StringVar ( )
mdp_label . set ( chaine )
label_mdp = Label ( fenetre , textvariable = mdp_label )
label_mdp = Label ( fenetre , textvariable = mdp_label , bg = fg_color , fg = str_color , width = w_elem , height = 3 )
label_mdp . grid ( row = 10 , column = 0 )
""" """
""" """
value1 = StringVar ( )
value1 . set ( " 10 " )
label1 = Label ( fenetre , text = " nombres de caracteres " )
""" label + entry nombres de caracteres """
label1 = Label ( fenetre , text = " nombres de caracteres " , bg = fg_color , fg = str_color , width = w_elem )
label1 . grid ( row = 0 , column = 0 )
entre1 = Entry ( fenetre , textvariable = value1 , width = 30 )
value1 = StringVar ( )
value1 . set ( " 10 " )
entre1 = Entry ( fenetre , textvariable = value1 , bg = fg_color , fg = str_color , width = w_entry )
entre1 . grid ( row = 1 , column = 0 )
""" """
""" """
""" label + entry nombres de majuscules """
label2 = Label ( fenetre , text = " nombres de majuscules " , bg = fg_color , fg = str_color , width = w_elem )
label2 . grid ( row = 2 , column = 0 )
value2 = StringVar ( )
value2 . set ( " 1 " )
label2 = Label ( fenetre , text = " nombres de majuscules " )
label2 . grid ( row = 2 , column = 0 )
entre2 = Entry ( fenetre , textvariable = value2 , width = 30 )
entre2 = Entry ( fenetre , textvariable = value2 , bg = fg_color , fg = str_color , width = w_entry )
entre2 . grid ( row = 3 , column = 0 )
""" """
""" """
""" label + entry nombres de chiffres """
label3 = Label ( fenetre , text = " nombres de chiffres " , bg = fg_color , fg = str_color , width = w_elem ) #
label3 . grid ( row = 4 , column = 0 )
value3 = StringVar ( )
value3 . set ( " 1 " )
label3 = Label ( fenetre , text = " nombres de chiffres " ) #
label3 . grid ( row = 4 , column = 0 )
entre3 = Entry ( fenetre , textvariable = value3 , width = 30 )
entre3 = Entry ( fenetre , textvariable = value3 , bg = fg_color , fg = str_color , width = w_entry )
entre3 . grid ( row = 5 , column = 0 )
""" """
""" """
value4 = StringVar ( )
value4 . set ( " 1 " )
label4 = Label ( fenetre , text = " nombres de caractere speciaux " )
""" label + entry nombres de caractere speciaux """
label4 = Label ( fenetre , text = " nombres de caractere speciaux " , bg = fg_color , fg = str_color , width = w_elem )
label4 . grid ( row = 6 , column = 0 )
entre4 = Entry ( fenetre , text = value4 , width = 30 )
entre4 . grid ( row = 7 , column = 0 )
value4 = StringVar ( )
value4 . set ( " 1 " )
entre4 = Entry ( fenetre , text = value4 , bg = fg_color , fg = str_color , width = w_entry )
entre4 . grid ( row = 7 , column = 0 , padx = 100 )
""" """
boutonv = Button ( text = " valider " , command = generer_mdp )
""" bouton valider """
boutonv = Button ( text = " valider " , command = generer_mdp , bg = fg_color , fg = str_color , activebackground = fg_color , activeforeground = str_color , width = w_elem )
boutonv . grid ( row = 8 , column = 0 )
""" """
""" labels mdp
mdp_est = StringVar ( )
mdp_est . set ( " Le mot de passe est : " )
label_mdp_est = Label ( fenetre , textvariable = mdp_est , bg = fg_color , fg = str_color , width = w_elem )
label_mdp_est . grid ( row = 9 , column = 0 )
mdp_label = StringVar ( )
mdp_label . set ( chaine )
label_mdp = Label ( fenetre , textvariable = mdp_label , bg = fg_color , fg = str_color , width = w_elem , height = 3 )
label_mdp . grid ( row = 10 , column = 0 )
"""
boutonpp = Button ( text = " copier dans le presse-papier " , command = copie )
""" bouton presse papier """
boutonpp = Button ( text = " copier dans le presse-papier " , command = copie , bg = fg_color , fg = str_color , activebackground = fg_color , activeforeground = str_color , width = w_elem )
boutonpp . grid ( row = 11 , column = 0 )
""" """