-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI_steg_part2.py
119 lines (59 loc) · 1.8 KB
/
GUI_steg_part2.py
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import tkinter as tk
from tkinter import *
from GUI_steg import embed
from GUI_steg import extract
def get_users_msg():
wind = tk.Tk()
wind.title("MESSAGE TO EMBED")
greeting = tk.Label( text='Enter desired secret message that will be embedded within the image\n')
greeting.pack()
wind.geometry('800x400')
wind['bg'] = '#26dddd'
entry = Entry(wind, width=300)
entry.pack(pady=0, padx=50)
the_msg = []
def get_message_from_user():
#print( entry.get() )
the_msg.append( entry.get() )
wind.destroy()
Button(
wind,
text="GO",
fg='white',
bg='black',
padx=5,
pady=5,
command=get_message_from_user,
).pack()
wind.mainloop()
return the_msg[0]
def get_pic_path():
user_path = ''
the_path = []
wind1 = tk.Tk()
wind1.title("Enter path to image")
greeting = tk.Label( text='Below, please enter the path to the desired image like the following example:\n'+r"C:\Users\user\image"+'\n' )#, width=20)
greeting.pack()
wind1.geometry('420x105')
entry = Entry(wind1, width=55)
entry.pack(pady=0, padx=50)
def do_destroy():
wind1.destroy()
def get_user_path_chars():
the_path.append( entry.get() )
do_destroy()
Button(
wind1,
text="GO",
fg='white',
bg='black',
padx=5,
pady=5,
command=get_user_path_chars,
).pack()
wind1.mainloop()
return the_path
# --- ENDING CONTROL PANEL CALLING OP FUNC'S ---
if( embed[0]==True and extract[0]==False ):
the_msg = get_users_msg()
the_path = get_pic_path()