Home > database >  Help: tkinter graphical interface
Help: tkinter graphical interface

Time:10-08

I want to call python third-party libraries to decrypt the file is encrypted, making the graphical interface to the system at present, the entire code I put in the three py file, but how do you call?
Below is the main code:
# coding=utf-8
The from tkinter import *
The from tkinter. Messagebox import *
The from encrypt_1 import *
The from decode_2 import *

Root=Tk ()
Root. Title (" file encryption decryption ")
Root. Geometry (" 450 x300 ")


# file encryption system
Def encrypt () :
Showinfo (" encryption system ", "welcome to file encryption system!" , the command=encrypt_1)



# file decryption system
Def decode () :
Showinfo (" decryption system ", "welcome to file decryption system!" )


ALabel=Label (root, text='welcome to decrypt the file encryption system! ', the font='script, 20', width=30, height=5, fg='red')
ALabel. Place (x=20, y=10)

# encryption system
C1=Button (root, text='encrypted file, the font=' 20 ', height=2, width=25, the command=encrypt)
C1. Place (x=80, y=150)

# decryption system
C1=Button (root, text='file decryption, the font=' 20 ', height=2, width=25, the command=decode)
C1. Place (x=80, y=200)
Root. Mainloop ()

Then there is an encryption and decryption module, temporary not consider decryption module, encryption module code is as follows:
# coding=utf-8
The from tkinter import *
The from tkinter. Messagebox import *
The from tkinter import filedialog

# test whether encryption password twice when input line
Def verify () :
If (E2. The get ()==E3. The get ()) :
Showinfo (" encryption success!" )
The else:
Showinfo (" password please enter match!" )

# browse local file
Def file_view () :
Root. Withdraw ()
File_select=filedialog. Askopenfilename ()


Root=Tk ()
Root. Title (" file encryption ")
Root. Geometry (" 450 x300 ")

L1=Label (root, text="choose file:")
L1. Place (x=10, y=10)
E1=Entry (root, bd=5, the font=12, width=15)
E1. Place (x=80, y=10)
B1=Button (root, text="browse", width=15, the command=file_view)
B1. Place (x=250, y=10)

L2=Label (root, text="secret code:")
L2. Place (=10 x, y=60)
E2=Entry (root, bd=5, the font=12, 15, width=show="*")
E2. Place (x=80, y=60)

L3=Label (root, text="verify password:")
L3. Place (x=10, y=110)
E3=Entry (root, bd=5, the font=12, 15, width=show="*")
E3. Place (x=80, y=110)

B2=Button (root, text="encrypted files," width=15, the command=verify)
B2. Place (x=100, y=150)

Now the main problem is:
1. How to call the content of the encryption module
2. How to open the browse local files encryption module, or browse, select the file path to fill into the text box of E1


Thank you for your attention!
 
  • Related