coding utf-8 from Tkinter import import tkFileDialog import paszi root

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# coding=utf-8
from Tkinter import *
import tkFileDialog
import paszi
root = Tk()
root.title('RSA program')
root.geometry('400x400')
I_Frame = Frame(root, height = 80, bg = 'Ivory')
II_Frame = Frame(root, height = 80, width = 60, bg='WhiteSmoke')
III_Frame = Frame(root, height = 80, width = 60, bg = 'GhostWhite')
IV_Frame = Frame(root, height = 80, width = 60, bg='WhiteSmoke')
V_Frame = Frame(root, height = 80, width = 60, bg='Ivory')
I_Frame.pack(side = 'top', fill = 'x')
II_Frame.pack(side = 'top', fill = 'x')
III_Frame.pack(side = 'top', fill = 'x')
IV_Frame.pack(side = 'top', fill = 'x')
V_Frame.pack(side = 'top', fill = 'x')
I_Enter = Entry(II_Frame)
I_Label = Label(III_Frame, text=u"\nЧто вы хотите сделать с файлом? \n ", font="Arial 17")
I_Label.pack()
I_Enter.place(x=10, y=20, width=220, height=40)
loadBtn = Button(II_Frame, text = u'Загрузить файл', bg='DimGray', fg='Azure')
encBtn = Button(IV_Frame, text = u'Зашифровать', bg='DimGray', fg='Azure')
decBtn = Button(IV_Frame, text = u'Расшифровать', bg='DimGray', fg='Azure')
filename = ''
def openFile():
global filename
filename = askopenfilename()
def encryptFile():
global filename
paszi.encrypt(filename,13,77)
def decryptFile():
global filename
paszi.decrypt(filename,36,77)
'''
def LoadFile():
fn = tkFileDialog.Open(root, filetypes = [('*.txt files', '.txt')]).show()
loadBtn.bind("<Button-1>", LoadFile)
encBtn.bind("<Button-1>", paszi.encrypt)
decBtn.bind("<Button-1>", paszi.decrypt)'''
loadBtn.place(x=250, y=20, width=140, height=40)
encBtn.place(x=10, y=20, widt =140, height=40)
decBtn.place(x=250, y=20, width=140, height=40)
loadBtn['command'] = openFile
encBtn['command'] = encryptFile
decBtn['command'] = decryptFile
root.mainloop()