4747
4848 icmd = input ("Enter ID:" )
4949 if icmd == '' :
50- print ("\033 [1;31;40m Error id. \033 [1;37;40m" )
50+ print ("\033 [1;31;40m Error id. \033 [1;37;40m\n " )
5151 else :
5252 d .execute ("SELECT id,name FROM db_password.tb_nap WHERE id= %s" ,(icmd ,)) #select id,name from id input
5353 i .execute ("SELECT password FROM db_password.tb_nap WHERE id= %s" ,(icmd ,)) #select password from id input
7171 decrypted = decrypted = f .decrypt (p_encode ) #decrypted
7272 ogpasswd = decrypted .decode () #decode from byte to string
7373
74- print ("Password for" ,p ,"is" ,ogpasswd ) #show id,name,password
74+ print ("Password for" ,p ,"is" ,ogpasswd , " \n \n " ) #show id,name,password
7575
7676
7777#insert
8181 p = input ("password>" )
8282
8383 if n == '' or p == '' : #detect blank input
84- print ("\033 [1;31;40m Can't insert into database.Plese input all of data. \033 [1;37;40m" )
84+ print ("\033 [1;31;40m Can't insert into database.Plese input all of data. \033 [1;37;40m\n " )
8585 else :
8686 k = ("key" ) #set key
8787 k_encode = k .encode () #encode key to byte
104104 mycursor .execute (sql , val )
105105 mydb .commit () #confirm operation to database
106106
107- print (mycursor .rowcount , "password inserted" ) #show number(s) of query that have inserted
107+ print (mycursor .rowcount , "password inserted\n \n " ) #show number(s) of query that have inserted
108108
109109#delete
110110elif cmd == 'd' or cmd == 'D' :
111111 mycursor .execute ("SELECT id,name FROM db_password.tb_nap" ) #select id,name from db
112112 myresult = mycursor .fetchall ()
113113 for x in myresult : #show id,name query in database
114- print ("What you want to delete" )
114+ print ("What you want to delete? " )
115115 print (x )
116116
117117 i = input ("Enter id:" ) #enter query id
123123 mycursor .execute (sql , (i ,))
124124 mydb .commit () #confirm operation to database
125125
126- print (mycursor .rowcount , "name and password deleted" ) #show number(s) of query that have deleted
126+ print (mycursor .rowcount , "name and password deleted\n \n " ) #show number(s) of query that have deleted
127127
128128#error
129129else :
130- print ("\033 [1;31;40m Error,Can't define command...plese try again \033 [1;37;40m\n " )
130+ print ("\033 [1;31;40m Error,Can't define command...plese try again \033 [1;37;40m\n " )
131+
132+ os .system ('pause' )
0 commit comments