Esempio n. 1
0
    def __init__(self):
        super().__init__()
        self.transient()
        self.resizable(False, False)
        #self.wm_attributes('-toolwindow', 'true')
        self.protocol("WM_DELETE_WINDOW", self.close)
        self.title('PhoneDialer')
        self.config(bg=utils.BACK)

        self.lbl = tk.Label(self,
                            text='Recent 4',
                            anchor='e',
                            bg=utils.BACK,
                            fg='white',
                            font=('Franklin Gothic Book', 14),
                            borderwidth=0)
        self.lbl.grid(
            row=0,
            columnspan=4,
            sticky='ew',
            padx=4,
            pady=2,
        )

        self.number = tk.Text(self,
                              width=7,
                              height=2,
                              font=('Franklin Gothic Book', 12),
                              bg=utils.BACK,
                              fg=utils.FRONT)
        self.number.grid(row=2, columnspan=2, sticky='ew', padx=4, pady=2)

        self.std_btn(utils.BACKSPACE_TEXT, utils.BACK, 2, 2, fg=utils.FRONT)

        self.std_btn("1", utils.BACK, 3,
                     0), self.std_btn("2", utils.BACK, 3,
                                      1), self.std_btn("3", utils.BACK, 3, 2),
        self.std_btn("4", utils.BACK, 4,
                     0), self.std_btn("5", utils.BACK, 4,
                                      1), self.std_btn("6", utils.BACK, 4, 2),
        self.std_btn("7", utils.BACK, 5,
                     0), self.std_btn("8", utils.BACK, 5,
                                      1), self.std_btn("9", utils.BACK, 5, 2),
        self.std_btn("*", utils.BACK, 6,
                     0), self.std_btn("0", utils.BACK, 6,
                                      1), self.std_btn("#", utils.BACK, 6, 2)
        self.std_btn(utils.CONTACTS_TEXT,
                     utils.BACK,
                     7,
                     0,
                     font=('Franklin Gothic Book', 28),
                     width=3,
                     height=1),
        self.std_btn(utils.CALL_TEXT,
                     utils.GREEN,
                     7,
                     1,
                     font=('Franklin Gothic Book', 28),
                     width=3,
                     height=1),
        self.std_btn(utils.RECENT_TEXT,
                     utils.BACK,
                     7,
                     2,
                     font=('Franklin Gothic Book', 28),
                     width=3,
                     height=1)

        self.number.focus_set()
        utils.checkDependencies(self)

        self.fillRecent()  #row1
Esempio n. 2
0
#entryUser = tkinter.Entry(win, textvariable=euser).grid(row=0, column=1)

#labelIp = tkinter.Label(win, text="ip").grid(row=1, column=0)
#eip = tkinter.Variable()
#entryIp = tkinter.Entry(win, textvariable=eip).grid(row=1, column=1)

#labelPort = tkinter.Label(win, text="port").grid(row=2, column=0)
#eport = tkinter.Variable()

#entryPort = tkinter.Entry(win, textvariable=eport).grid(row=2, column=1)

button = tkinter.Button(win,
                        text="Login",
                        font=('Impact', 20),
                        command=connectServer).place(x=480, y=250)
text = tkinter.Text(win, height=20, width=120)
labeltext = tkinter.Label(win, text="Message",
                          font=('Impact', 20)).place(x=100, y=300)
text.place(x=90, y=350)

esend = tkinter.Variable()
#labelesend = tkinter.Label(win, text="发送的消息").grid(row=5, column=0)
entrySend = tkinter.Entry(win,
                          textvariable=esend,
                          font=('Arial', 20),
                          width=50).place(x=90, y=620)

#efriend = tkinter.Variable()
#labelefriend= tkinter.Label(win, text="SendTo",font=('Impact',15)).place(x=90,y=620)
#entryFriend = tkinter.Entry(win, textvariable=efriend,font=('Arial',20)).place(x=150,y=620)
Esempio n. 3
0
def decrypt_tk():
    text_data = user_text.get('0.0', tkinter.END).strip()
    if text_data == '':
        messagebox.showerror('Error', 'Text is Empty!')
        return

    text_to_decrypt = text_data.encode()

    result_text.delete('0.0', tkinter.END)
    result_text.insert('0.0', decrypt_message(text_to_decrypt))


image = tkinter.PhotoImage(file='banner.png')
tkinter.Label(root, image=image).pack()

user_text = tkinter.Text(root, height=10)
user_text.pack()

buttons_frame = tkinter.Frame(root)
buttons_frame.pack()

mybtn = tkinter.Button(buttons_frame, text='Encrypt', command=encrypt_tk)
mybtn.pack(side='left', pady=5, padx=10)

mybtn = tkinter.Button(buttons_frame, text='Decrypt', command=decrypt_tk)
mybtn.pack(side='left', pady=5, padx=10)


def show_about():
    about_page = tkinter.Toplevel(root)
    about_page.title('About Program')
Esempio n. 4
0
def cut_face():
    in_f = t1.get(1.0, tk.END)[:-1]
    print(type(in_f))
    in_f = in_f.decode('utf-8')
    print(in_f)
    out_f = t2.get(1.0, tk.END)[:-1]
    out_f = out_f.decode('utf-8')
    print(out_f)
    #    detect(in_f,out_f)
    label4 = tk.Label(root, text="完成")  #建立標籤物件
    label4.pack()  #將元件放入容器


label1 = tk.Label(root, text="輸入圖片")  #建立標籤物件
label1.pack()  #將元件放入容器
button1 = tk.Button(root, text="選擇位置", command=a)
button1.pack()  #將元件放入容器
t1 = tk.Text(root, height=2)
t1.pack()
label2 = tk.Label(root, text="輸出圖片")  #建立標籤物件
label2.pack()  #將元件放入容器
button2 = tk.Button(root, text="選擇位置及檔名", command=b)
button2.pack()  #將元件放入容器
t2 = tk.Text(root, height=2)
t2.pack()
label3 = tk.Label(root, text="大頭貼轉換")  #建立標籤物件
label3.pack()  #將元件放入容器
button3 = tk.Button(root, text="開始", command=cut_face)
button3.pack()
root.mainloop()
Esempio n. 5
0
 def init_chatfield(self):
     self.chatfield = tkinter.Text(width=30, height=10, state='disabled')
     self.chatfield.grid(row=0, column=1, rowspan=7, padx=20, pady=5)
Esempio n. 6
0
align_left_btn.grid(row=0, column=7, padx=5)

# center_align btn
align_center_icon = tk.PhotoImage(file=r".\icons\center.png")
align_center_btn = ttk.Button(toolbar, image=align_center_icon)
align_center_btn.grid(row=0, column=8, padx=5)

# right_align btn
align_right_icon = tk.PhotoImage(file=r".\icons\right.png")
align_right_btn = ttk.Button(toolbar, image=align_right_icon)
align_right_btn.grid(row=0, column=9, padx=5)

#------------------End toolbar--------------#

################### text editor ################
text_editor = tk.Text(application, undo=True)
text_editor.config(wrap="word", relief=tk.FLAT)

scroll_bar = tk.Scrollbar(application)
text_editor.focus_set()
scroll_bar.pack(side=tk.RIGHT, fill=tk.Y)
text_editor.pack(fill=tk.BOTH, expand=True)
scroll_bar.config(command=text_editor.yview)
text_editor.config(yscrollcommand=scroll_bar.set)

# font family and font size functionality
current_font = "Arial"
current_font_size = 14


def change_font(application):
Esempio n. 7
0
            web = 'https://www.google.com.pk/search?source=hp&ei=ez3gXMTDM-WRlwSC_o7IBg&q=' + inputer
            webbrowser.open_new_tab(web)
            s.runAndWait()
            break
    search(inputer,els)
def search(inpu,le):
    if(le==''):
        s.say('searching')
        web = 'https://www.google.com.pk/search?source=hp&ei=ez3gXMTDM-WRlwSC_o7IBg&q=' + inpu
        webbrowser.open_new_tab(web)
        s.runAndWait()
p.geometry("700x600")
l1 = tk.Label(p,text = "Let's Chat Type Below")
l2 = tk.Entry(p)
l3 = tk.Button(p,text = 'CHAT',command = chat)
l4 = tk.Text(p,height=20, width=50)
l5 = tk.Label(p,text = "For searching anything type 'search'+'anything you desire'")
l4.pack()
l1.pack()
l2.pack()
l3.pack()
l5.pack()
p.mainloop()


# In[ ]:




Esempio n. 8
0

var = 'test.mid'
wavvar = 'test.wav'
playing = False
# 第1步,实例化object,建立窗口window
window = tk.Tk()
window.resizable(0, 0)
window.wm_state('zoomed')  #默认最大化
#插入背景图片
im = Image.open('timg1.jpg')  #'C:\\Users\\李方怡\\Desktop\\SLP\\timg1.jpg'
img = ImageTk.PhotoImage(im.resize((1550, 900), Image.ANTIALIAS))
imLabel = tk.Label(window, image=img).pack()
#建立输出文本框
scroll = tk.Scrollbar()
lrc = tk.Text(window, font=('Comic Sans MS', 30), fg='white', bg='BlueViolet')
scroll.pack(side=tk.RIGHT, fill=tk.Y)  # side是滚动条放置的位置,上下左右。fill是将滚动条沿着y轴填充
lrc.pack(side=tk.LEFT, fill=tk.Y)  # 将文本框填充进wuya窗口的左侧,
# 将滚动条与文本框关联
scroll.config(command=lrc.yview)  # 将文本框关联到滚动条上,滚动条滑动,文本框跟随滑动
lrc.config(yscrollcommand=scroll.set)  # 将滚动条关联到文本框
lrc.place(rely=0.7, relx=0.3, relwidth=0.4, relheight=0.15)

txt = tk.Text(window, font=('Comic Sans MS', 20), fg='white', bg='BlueViolet')
txt.place(rely=0.85, relx=0.3, relwidth=0.4, relheight=0.05)
# 第2步,给窗口的可视化起名字
window.title('音准检测')

# 第3步,设定窗口的大小(长 * 宽)
window.geometry('1550x900')  # 这里的乘是小x
    def __init__(self, top):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        __bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        __fgcolor = '#000000'  # X11 color: 'black'
        __compcolor = '#d9d9d9'  # X11 color: 'gray85'
        _ana1color = '#d9d9d9'  # X11 color: 'gray85'
        __ana2color = '#ececec'  # Closest X11 color: 'gray92'
        font10 = "-family {Segoe UI} -size 11 -weight bold -slant "  \
            "roman -underline 0 -overstrike 0"
        font11 = "-family {Segoe UI} -size 12 -weight bold -slant "  \
            "roman -underline 0 -overstrike 0"
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.', background=__bgcolor)
        self.style.configure('.', foreground=__fgcolor)
        self.style.configure('.', font="TkDefaultFont")
        self.style.map('.',
                       background=[('selected', __compcolor),
                                   ('active', __ana2color)])

        top.geometry("495x532+663+175")
        top.title("Klasifikasi")
        top.configure(background="#d9d9d9")

        self.FrameDiskritisasi = tk.Frame(top)
        self.FrameDiskritisasi.place(relx=0.061,
                                     rely=0.038,
                                     relheight=0.254,
                                     relwidth=0.899)
        self.FrameDiskritisasi.configure(relief='groove')
        self.FrameDiskritisasi.configure(borderwidth="2")
        self.FrameDiskritisasi.configure(relief='groove')
        self.FrameDiskritisasi.configure(background="#d9d9d9")
        self.FrameDiskritisasi.configure(width=445)

        self.ButtonDiskritisasi = tk.Button(self.FrameDiskritisasi)
        self.ButtonDiskritisasi.place(relx=0.045,
                                      rely=0.222,
                                      height=24,
                                      width=97)
        self.ButtonDiskritisasi.configure(activebackground="#ececec")
        self.ButtonDiskritisasi.configure(activeforeground="#000000")
        self.ButtonDiskritisasi.configure(background="#d9d9d9")
        self.ButtonDiskritisasi.configure(disabledforeground="#a3a3a3")
        self.ButtonDiskritisasi.configure(foreground="#000000")
        self.ButtonDiskritisasi.configure(highlightbackground="#d9d9d9")
        self.ButtonDiskritisasi.configure(highlightcolor="black")
        self.ButtonDiskritisasi.configure(pady="0")
        self.ButtonDiskritisasi.configure(text='''Input Data''')
        self.ButtonDiskritisasi.configure(width=97)
        self.ButtonDiskritisasi.configure(command=self.setFileDiskrit)

        self.ProgressBar = ttk.Progressbar(top)
        self.ProgressBar.place(relx=0.37, rely=0.245)
        self.ProgressBar.configure(mode="indeterminate")
        self.ProgressBar.lower(self.FrameDiskritisasi)

        self.AlamatDiskritisasi = tk.Text(self.FrameDiskritisasi)
        self.AlamatDiskritisasi.place(relx=0.315,
                                      rely=0.222,
                                      relheight=0.278,
                                      relwidth=0.593)
        self.AlamatDiskritisasi.configure(background="white")
        self.AlamatDiskritisasi.configure(font="TkTextFont")
        self.AlamatDiskritisasi.configure(foreground="black")
        self.AlamatDiskritisasi.configure(highlightbackground="#d9d9d9")
        self.AlamatDiskritisasi.configure(highlightcolor="black")
        self.AlamatDiskritisasi.configure(insertbackground="black")
        self.AlamatDiskritisasi.configure(selectbackground="#c4c4c4")
        self.AlamatDiskritisasi.configure(selectforeground="black")
        self.AlamatDiskritisasi.configure(state='disabled')
        self.AlamatDiskritisasi.configure(width=264)
        self.AlamatDiskritisasi.configure(wrap='word')

        self.ButtonProsesDiskrit = tk.Button(self.FrameDiskritisasi)
        self.ButtonProsesDiskrit.place(relx=0.315,
                                       rely=0.593,
                                       height=24,
                                       width=127)
        self.ButtonProsesDiskrit.configure(activebackground="#ececec")
        self.ButtonProsesDiskrit.configure(activeforeground="#000000")
        self.ButtonProsesDiskrit.configure(background="#d9d9d9")
        self.ButtonProsesDiskrit.configure(disabledforeground="#a3a3a3")
        self.ButtonProsesDiskrit.configure(foreground="#000000")
        self.ButtonProsesDiskrit.configure(highlightbackground="#d9d9d9")
        self.ButtonProsesDiskrit.configure(highlightcolor="black")
        self.ButtonProsesDiskrit.configure(pady="0")
        self.ButtonProsesDiskrit.configure(text='''Diskritisasi Data''')
        self.ButtonProsesDiskrit.configure(width=127)
        self.ButtonProsesDiskrit.configure(command=self.buttonPressDiskrit)

        self.LabelWaktuDiskrit = tk.Label(top)
        self.LabelWaktuDiskrit.place(relx=0.59,
                                     rely=0.24,
                                     height=21,
                                     width=180)
        self.LabelWaktuDiskrit.configure(background="#d9d9d9")
        self.LabelWaktuDiskrit.configure(disabledforeground="#a3a3a3")
        self.LabelWaktuDiskrit.configure(foreground="#000000")
        self.LabelWaktuDiskrit.lower(self.FrameDiskritisasi)

        self.Frame2 = tk.Frame(top)
        self.Frame2.place(relx=0.061,
                          rely=0.32,
                          relheight=0.57,
                          relwidth=0.899)
        self.Frame2.configure(relief='groove')
        self.Frame2.configure(borderwidth="2")
        self.Frame2.configure(relief='groove')
        self.Frame2.configure(background="#d9d9d9")
        self.Frame2.configure(width=445)

        self.LabelLatih = tk.Label(self.Frame2)
        self.LabelLatih.place(relx=0.045, rely=0.09, height=26, width=41)
        self.LabelLatih.configure(activeforeground="#000000")
        self.LabelLatih.configure(background="#d9d9d9")
        self.LabelLatih.configure(disabledforeground="#a3a3a3")
        self.LabelLatih.configure(font=font10)
        self.LabelLatih.configure(foreground="#000000")
        self.LabelLatih.configure(text='''Latih''')

        self.ButtonDataLatih = tk.Button(self.Frame2)
        self.ButtonDataLatih.place(relx=0.045,
                                   rely=0.179,
                                   height=24,
                                   width=117)
        self.ButtonDataLatih.configure(activebackground="#ececec")
        self.ButtonDataLatih.configure(activeforeground="#000000")
        self.ButtonDataLatih.configure(background="#d9d9d9")
        self.ButtonDataLatih.configure(disabledforeground="#a3a3a3")
        self.ButtonDataLatih.configure(foreground="#000000")
        self.ButtonDataLatih.configure(highlightbackground="#d9d9d9")
        self.ButtonDataLatih.configure(highlightcolor="black")
        self.ButtonDataLatih.configure(pady="0")
        self.ButtonDataLatih.configure(text='''Input Data Latih''')
        self.ButtonDataLatih.configure(width=117)
        self.ButtonDataLatih.configure(command=self.setFileLatih)

        self.AlamatDataLatih = tk.Text(self.Frame2)
        self.AlamatDataLatih.place(relx=0.382,
                                   rely=0.179,
                                   relheight=0.102,
                                   relwidth=0.503)
        self.AlamatDataLatih.configure(background="white")
        self.AlamatDataLatih.configure(font="TkTextFont")
        self.AlamatDataLatih.configure(foreground="black")
        self.AlamatDataLatih.configure(highlightbackground="#d9d9d9")
        self.AlamatDataLatih.configure(highlightcolor="black")
        self.AlamatDataLatih.configure(insertbackground="black")
        self.AlamatDataLatih.configure(selectbackground="#c4c4c4")
        self.AlamatDataLatih.configure(selectforeground="black")
        self.AlamatDataLatih.configure(state='disabled')
        self.AlamatDataLatih.configure(width=224)
        self.AlamatDataLatih.configure(wrap='word')

        self.ButtonLatih = tk.Button(self.Frame2)
        self.ButtonLatih.place(relx=0.315, rely=0.418, height=24, width=117)
        self.ButtonLatih.configure(activebackground="#ececec")
        self.ButtonLatih.configure(activeforeground="#000000")
        self.ButtonLatih.configure(background="#d9d9d9")
        self.ButtonLatih.configure(disabledforeground="#a3a3a3")
        self.ButtonLatih.configure(foreground="#000000")
        self.ButtonLatih.configure(highlightbackground="#d9d9d9")
        self.ButtonLatih.configure(highlightcolor="black")
        self.ButtonLatih.configure(pady="0")
        self.ButtonLatih.configure(text='''Latih Data''')
        self.ButtonLatih.configure(width=117)
        self.ButtonLatih.configure(command=self.latihData)

        self.Algorithm = tk.StringVar()
        self.TComboAlgoritma = ttk.Combobox(self.Frame2)
        self.TComboAlgoritma.place(relx=0.382,
                                   rely=0.299,
                                   relheight=0.063,
                                   relwidth=0.389)
        self.TComboAlgoritma.configure(textvariable='tes_support.combobox')
        self.TComboAlgoritma.configure(width=173)
        self.TComboAlgoritma.configure(takefocus="")
        self.TComboAlgoritma.configure(values=['Naive Bayes', 'Gaussian NB'])
        self.TComboAlgoritma.configure(state="readonly")
        self.TComboAlgoritma.configure(textvariable=self.Algorithm)
        self.TComboAlgoritma.bind('<<ComboboxSelected>>', self.checkBoxEnabler)

        self.LabelAlgoritma = tk.Label(self.Frame2)
        self.LabelAlgoritma.place(relx=0.045, rely=0.299, height=21, width=113)
        self.LabelAlgoritma.configure(background="#d9d9d9")
        self.LabelAlgoritma.configure(disabledforeground="#a3a3a3")
        self.LabelAlgoritma.configure(foreground="#000000")
        self.LabelAlgoritma.configure(text='''Algoritma Klasifikasi''')

        self.LabelUji = tk.Label(self.Frame2)
        self.LabelUji.place(relx=0.045, rely=0.567, height=26, width=25)
        self.LabelUji.configure(background="#d9d9d9")
        self.LabelUji.configure(disabledforeground="#a3a3a3")
        self.LabelUji.configure(font=font10)
        self.LabelUji.configure(foreground="#000000")
        self.LabelUji.configure(text='''Uji''')

        self.ButtonDataUji = tk.Button(self.Frame2)
        self.ButtonDataUji.place(relx=0.045, rely=0.657, height=24, width=117)
        self.ButtonDataUji.configure(activebackground="#ececec")
        self.ButtonDataUji.configure(activeforeground="#000000")
        self.ButtonDataUji.configure(background="#d9d9d9")
        self.ButtonDataUji.configure(disabledforeground="#a3a3a3")
        self.ButtonDataUji.configure(foreground="#000000")
        self.ButtonDataUji.configure(highlightbackground="#d9d9d9")
        self.ButtonDataUji.configure(highlightcolor="black")
        self.ButtonDataUji.configure(pady="0")
        self.ButtonDataUji.configure(text='''Input Data Uji''')
        self.ButtonDataUji.configure(width=117)
        self.ButtonDataUji.configure(command=self.setFileUji)

        self.Checker = tk.IntVar()
        self.CheckModelDiskrit = tk.Checkbutton(self.Frame2)
        self.CheckModelDiskrit.place(relx=0.034,
                                     rely=0.726,
                                     relheight=0.075,
                                     relwidth=0.333)
        self.CheckModelDiskrit.configure(activebackground="#ececec")
        self.CheckModelDiskrit.configure(activeforeground="#000000")
        self.CheckModelDiskrit.configure(background="#d9d9d9")
        self.CheckModelDiskrit.configure(disabledforeground="#a3a3a3")
        self.CheckModelDiskrit.configure(foreground="#000000")
        self.CheckModelDiskrit.configure(highlightbackground="#d9d9d9")
        self.CheckModelDiskrit.configure(highlightcolor="black")
        self.CheckModelDiskrit.configure(justify='left')
        self.CheckModelDiskrit.configure(state='disabled')
        self.CheckModelDiskrit.configure(text='''Gunakan Model Diskrit''')
        self.CheckModelDiskrit.configure(variable=self.Checker)

        self.AlamatDataUji = tk.Text(self.Frame2)
        self.AlamatDataUji.place(relx=0.382,
                                 rely=0.657,
                                 relheight=0.102,
                                 relwidth=0.503)
        self.AlamatDataUji.configure(background="white")
        self.AlamatDataUji.configure(font="TkTextFont")
        self.AlamatDataUji.configure(foreground="black")
        self.AlamatDataUji.configure(highlightbackground="#d9d9d9")
        self.AlamatDataUji.configure(highlightcolor="black")
        self.AlamatDataUji.configure(insertbackground="black")
        self.AlamatDataUji.configure(selectbackground="#c4c4c4")
        self.AlamatDataUji.configure(selectforeground="black")
        self.AlamatDataUji.configure(state='disabled')
        self.AlamatDataUji.configure(width=224)
        self.AlamatDataUji.configure(wrap='word')

        self.ButtonUji = tk.Button(self.Frame2)
        self.ButtonUji.place(relx=0.315, rely=0.806, height=24, width=117)
        self.ButtonUji.configure(activebackground="#ececec")
        self.ButtonUji.configure(activeforeground="#000000")
        self.ButtonUji.configure(background="#d9d9d9")
        self.ButtonUji.configure(disabledforeground="#a3a3a3")
        self.ButtonUji.configure(foreground="#000000")
        self.ButtonUji.configure(highlightbackground="#d9d9d9")
        self.ButtonUji.configure(highlightcolor="black")
        self.ButtonUji.configure(pady="0")
        self.ButtonUji.configure(text='''Uji Data''')
        self.ButtonUji.configure(width=117)
        self.ButtonUji.configure(command=self.ujiData)

        self.LabelDiskrit = tk.Label(top)
        self.LabelDiskrit.place(relx=0.101, rely=0.019, height=21, width=101)
        self.LabelDiskrit.configure(background="#d9d9d9")
        self.LabelDiskrit.configure(disabledforeground="#a3a3a3")
        self.LabelDiskrit.configure(font=font11)
        self.LabelDiskrit.configure(foreground="#000000")
        self.LabelDiskrit.configure(text='''DISKRITISASI''')
        self.LabelDiskrit.configure(width=101)

        self.LabelKlasifikasi = tk.Label(top)
        self.LabelKlasifikasi.place(relx=0.101,
                                    rely=0.301,
                                    height=21,
                                    width=109)

        self.LabelKlasifikasi.configure(activeforeground="#000000")
        self.LabelKlasifikasi.configure(background="#d9d9d9")
        self.LabelKlasifikasi.configure(disabledforeground="#a3a3a3")
        self.LabelKlasifikasi.configure(font=font10)
        self.LabelKlasifikasi.configure(foreground="#000000")
        self.LabelKlasifikasi.configure(text='''KLASIFIKASI''')
        self.LabelKlasifikasi.configure(width=109)

        self.LabelModelLatih = tk.Label(top)
        self.LabelModelLatih.place(relx=0.629, rely=0.56, height=21, width=116)
        self.LabelModelLatih.configure(background="#d9d9d9")
        self.LabelModelLatih.configure(disabledforeground="#a3a3a3")
        self.LabelModelLatih.configure(foreground="#000000")
        self.LabelModelLatih.configure(text='''Model Latih Tersedia''')
        self.LabelModelLatih.lower(self.Frame2)

        self.LabelWaktuLatih = tk.Label(top)
        self.LabelWaktuLatih.place(relx=0.61, rely=0.62, height=21, width=140)
        self.LabelWaktuLatih.configure(background="#d9d9d9")
        self.LabelWaktuLatih.configure(disabledforeground="#a3a3a3")
        self.LabelWaktuLatih.configure(foreground="#000000")
        self.LabelWaktuLatih.lower(self.Frame2)

        self.LabelWaktuUji = tk.Label(top)
        self.LabelWaktuUji.place(relx=0.6, rely=0.84, height=21, width=140)
        self.LabelWaktuUji.configure(background="#d9d9d9")
        self.LabelWaktuUji.configure(disabledforeground="#a3a3a3")
        self.LabelWaktuUji.configure(foreground="#000000")
        self.LabelWaktuUji.configure(text="OMEGALUL3")
        self.LabelWaktuUji.lower(self.Frame2)

        self.LabelAkurasi = tk.Label(top)
        self.LabelAkurasi.place(relx=0.6, rely=0.76, height=21, width=140)
        self.LabelAkurasi.configure(background="#d9d9d9")
        self.LabelAkurasi.configure(disabledforeground="#a3a3a3")
        self.LabelAkurasi.configure(foreground="#000000")
        self.LabelAkurasi.configure(text="OMEGALUL")
        self.LabelAkurasi.lower(self.Frame2)

        self.LabelWaktuApply = tk.Label(top)
        self.LabelWaktuApply.place(relx=0.6, rely=0.80, height=21, width=140)
        self.LabelWaktuApply.configure(background="#d9d9d9")
        self.LabelWaktuApply.configure(disabledforeground="#a3a3a3")
        self.LabelWaktuApply.configure(foreground="#000000")
        self.LabelWaktuApply.configure(text="OMEGALUL2")
        self.LabelWaktuApply.lower(self.Frame2)

        self.ImportedFile = FileImp()
        self.ObjDiskrit = None
        self.NaiveBayes = None
        self.GNB = None
        self.Threadlist = []
 def add_text_box(self, msg, rrr, ccc):
     self.text = tk.Text(self.master)
     self.text.insert(tk.END, msg)
     self.text.grid(row=rrr, column=ccc, sticky="nsew")
Esempio n. 11
0
_ana1color = '#d9d9d9'  # X11 color: 'gray85'
_ana2color = '#ececec'  # Closest X11 color: 'gray92'

top.geometry("388x433+461+125")
top.title("Chat")
top.configure(background="#d9d9d9")
top.chatFrame = tk.Frame(top)
top.chatFrame.place(relx=0.0, rely=0.0, relheight=0.982, relwidth=0.992)

top.chatFrame.configure(relief='groove')
top.chatFrame.configure(borderwidth="2")
top.chatFrame.configure(relief='groove')
top.chatFrame.configure(background="#d9d9d9")
top.chatFrame.configure(width=385)

top.msgTextBox = tk.Text(top.chatFrame)
top.msgTextBox.place(relx=0.026, rely=0.8, relheight=0.193, relwidth=0.774)
top.msgTextBox.configure(background="white")
top.msgTextBox.configure(font="TkTextFont")
top.msgTextBox.configure(foreground="black")
top.msgTextBox.configure(highlightbackground="#d9d9d9")
top.msgTextBox.configure(highlightcolor="black")
top.msgTextBox.configure(insertbackground="black")
top.msgTextBox.configure(selectbackground="#c4c4c4")
top.msgTextBox.configure(selectforeground="black")
top.msgTextBox.configure(width=298)
top.msgTextBox.configure(wrap='word')
top.msgTextBox.bind("<Return>", enterclicked)

top.sendButton = tk.Button(top.chatFrame)
top.sendButton.place(relx=0.805, rely=0.871, height=22, width=71)
Esempio n. 12
0
    global X2, Y2
    X2, Y2 = win.winfo_pointerxy()
    print("X2 :" + str(X2))
    print("Y2:" + str(Y2))


def save_cord():
    global X1, X2, Y1, Y2
    config = {'X1': X1, 'X2': X2, 'Y1': Y1, 'Y2': Y2}

    with open('config.json', 'w') as f:
        json.dump(config, f)
    exit()


text = tk.Text(win, height=2)
text.pack()
text.insert(tk.END, "Flipkart Gamezone")

openBtn = tk.Button(win, text='Search', command=screenshot_search, bg="green")
openBtn.pack(expand=tk.FALSE, fill=tk.X, side=tk.TOP)

openBtn = tk.Button(win, text='Exit', command=exit_, bg="red")
openBtn.pack(expand=tk.FALSE, fill=tk.X, side=tk.RIGHT)

openBtn = tk.Button(win, text='X1-Y1', command=get_x1_y1, bg="blue")
openBtn.pack(expand=tk.FALSE, fill=tk.X, side=tk.LEFT)

openBtn = tk.Button(win, text='X2-Y2', command=get_x2_y2, bg="blue")
openBtn.pack(expand=tk.FALSE, fill=tk.X, side=tk.LEFT)
Esempio n. 13
0
    def __init__(self, parent):
        self.parent = parent

        self.text = tkinter.Text(self.parent)
Esempio n. 14
0
    def create_intensityslicing_tab(self, tab):
        # Tab 2 contents - Intensity slicing
        lf = ttk.Labelframe(tab, text='Select methods', height=350, width=200)
        lf.place(x=20, y=20)

        # Channels
        channel = tk.IntVar()
        tk.Radiobutton(lf, text="RGB", variable=channel, value=1).place(x=10,
                                                                        y=10)
        tk.Radiobutton(lf, text="HSI", variable=channel, value=2).place(x=60,
                                                                        y=10)
        tk.Radiobutton(lf, text="CMYK", variable=channel, value=3).place(x=110,
                                                                         y=10)
        tk.Frame(lf, height=2, width=170, bd=1, relief="sunken").place(x=10,
                                                                       y=50)

        # Color
        color = tk.IntVar()
        tk.Radiobutton(lf, text="Red", variable=color, value=1).place(x=10,
                                                                      y=60)
        tk.Radiobutton(lf, text="Green", variable=color, value=2).place(x=10,
                                                                        y=90)
        tk.Radiobutton(lf, text="Blue", variable=color, value=3).place(x=10,
                                                                       y=120)
        tk.Frame(lf, height=2, width=170, bd=1, relief="sunken").place(x=10,
                                                                       y=160)

        # Minimun intensity found in image
        imin_text = tk.Text(lf,
                            height=2,
                            width=5,
                            font=("TkDefaultFont", 9, "normal"),
                            relief="flat",
                            bg="gray94")
        imin_text.place(x=10, y=180)
        imin_text.insert("end", "Min I:")

        i_min = tk.StringVar()
        imin_entry = tk.Entry(lf,
                              width=5,
                              relief="flat",
                              bg="gray94",
                              textvariable=i_min)
        imin_entry.place(x=60, y=180)
        i_min.set(str(.158))

        # Max intensity found in image
        imax_text = tk.Text(lf,
                            height=2,
                            width=5,
                            font=("TkDefaultFont", 9, "normal"),
                            relief="flat",
                            bg="gray94")
        imax_text.place(x=10, y=200)
        imax_text.insert("end", "Max I:")

        i_max = tk.StringVar()
        imax_entry = tk.Entry(lf,
                              width=5,
                              relief="flat",
                              bg="gray94",
                              textvariable=i_max)
        imax_entry.place(x=60, y=200)
        i_max.set(str(.858))

        # Minimum intensity value for slicing
        smin_text = tk.Text(lf,
                            height=2,
                            width=10,
                            font=("TkDefaultFont", 9, "normal"),
                            relief="flat",
                            bg="gray94")
        smin_text.place(x=10, y=230)
        smin_text.insert("end", "Min Slicing:")

        s_min_spinbox = tk.Spinbox(lf, width=5, from_=0, to=1, increment=.001)
        s_min_spinbox.place(x=100, y=230)

        # Max intensity value for slicing
        smax_text = tk.Text(lf,
                            height=2,
                            width=10,
                            font=("TkDefaultFont", 9, "normal"),
                            relief="flat",
                            bg="gray94")
        smax_text.place(x=10, y=250)
        smax_text.insert("end", "Max Slicing:")

        s_max_spinbox = tk.Spinbox(lf, width=5, from_=0, to=1, increment=.001)
        s_max_spinbox.place(x=100, y=250)
canvas.place(x=0, y=0, relheight=1, relwidth=1)
img = ImageTk.PhotoImage(file="pasta1.jpg")
canvas.create_image(1400, 37, anchor=NW, image=img)

label = Label(root,
              text="MIXED SAUCE PASTA",
              font="Helvetica 15 bold",
              pady=3,
              padx=3,
              bd=2,
              fg='white',
              bg='black',
              relief=RAISED)
label.place(x=0, y=2, relwidth=1)

t = tk.Text(root, bg='white', fg='black', font="Helvetica 14 bold")
t.place(x=2, y=37, height=900, width=800)
quote = """ 
                    RECIPE OF MIXED SAUCE PASTA

Step 1
Boil 1 potato overnight for about an hour. Next morning, peel
the skin of the potatoes and mash them. Then blend it in the
mixer along with tomatoes.

Step 2
On the other hand, start boiling the macaroni and add salt and
oil to the pot. Boil it for about 10 minutes. Also, slice the
other potato finely and add it to the mix.

Step 3
    t1.delete(1.0, tk.END)
    t2.delete(1.0, tk.END)
    t3.delete(1.0, tk.END)
    kg = float(e1_value.get())
    g = kg * 1000
    lb = kg * 2.20462
    oz = kg * 35.274
    t1.insert(tk.END, g)
    t2.insert(tk.END, lb)
    t3.insert(tk.END, oz)


b1 = tk.Button(window, text='Convert', command=kg_to_g_lb_oz)
b1.grid(row=0, column=2)

e1_value = tk.StringVar()
e1 = tk.Entry(window, textvariable=e1_value)
e1.grid(row=0, column=1)

w1 = tk.Label(window, text='kg')
w1.grid(row=0, column=0)

t1 = tk.Text(height=1, width=20)
t1.grid(row=1, column=0)
t2 = tk.Text(height=1, width=20)
t2.grid(row=1, column=1)
t3 = tk.Text(height=1, width=20)
t3.grid(row=1, column=2)

window.mainloop()
Esempio n. 17
0
    def create_widgets(self):
        """
        Metoda zawiera inicjalizację komponentów widoku.

        """
        # FRAMES
        self.__main_frame = tk.LabelFrame(self.__container,
                                          text="Glimpse on Earth",
                                          width=self.width,
                                          height=self.height,
                                          bg=colors.main_background_color,
                                          fg=colors.main_font_color,
                                          font=("Courier", 10))
        self.__top_frame = tk.Frame(self.__main_frame,
                                    highlightbackground="Black",
                                    width=self.__width,
                                    height=self.height / 10,
                                    bg=colors.main_background_color)
        self.__picture_frame = tk.LabelFrame(
            self.__main_frame,
            text="Photo preview",
            width=self.width,
            height=((self.__height / 10) * 4),
            bg=colors.preview_backgorund_color,
            fg=colors.main_font_color,
            font=("Courier", 10))
        self.__data_frame = tk.Frame(self.__main_frame,
                                     highlightbackground="Black",
                                     width=self.__width,
                                     height=((self.__height / 10) * 4),
                                     bg=colors.preview_backgorund_color)
        self.__bottom_frame = tk.Frame(self.__main_frame,
                                       highlightbackground="Black",
                                       width=self.__width,
                                       height=self.height / 12,
                                       bg=colors.main_background_color)

        self.__coordinates_frame = tk.Frame(self.__data_frame,
                                            bg=colors.preview_backgorund_color)

        # BUTTONS
        self.__upload_earth_pic_button = tk.Button(
            self.__top_frame,
            width=20,
            text="Upload Earth pic",
            command=self.upload_earth_pic_country_changed,
            bg=colors.button_color,
            fg=colors.button_font_color)

        self.__open_in_browser_button = tk.Button(self.__bottom_frame,
                                                  width=23,
                                                  text="Open in browser",
                                                  command=self.open_in_browser,
                                                  bg=colors.button_color,
                                                  fg=colors.button_font_color)
        self.__upload_img_button = tk.Button(self.__bottom_frame,
                                             width=23,
                                             text="Show image",
                                             command=self.show_earth_image,
                                             bg=colors.button_color,
                                             fg=colors.button_font_color)
        self.___save_img_button = tk.Button(
            self.__bottom_frame,
            width=23,
            text="Save image",
            command=self.save_image_window_create,
            bg=colors.button_color,
            fg=colors.button_font_color)

        # IMAGE
        self.__img_mini_earth_label = tk.Label(
            self.__picture_frame,
            width=self.width,
            height=(int((self.__height / 10) * 3)),
            background=colors.main_background_color)

        # TEXT
        self.__latitude = tk.Text(self.__coordinates_frame,
                                  height=2,
                                  background=colors.preview_backgorund_color,
                                  foreground=colors.main_font_color)
        self.__longtitude = tk.Text(self.__coordinates_frame,
                                    height=2,
                                    background=colors.preview_backgorund_color,
                                    foreground=colors.main_font_color)

        # LABELS
        self.__latitude_label = tk.Label(
            self.__coordinates_frame,
            text="Latitude: ",
            font=("Courier", 12),
            background=colors.preview_backgorund_color,
            foreground=colors.main_font_color)
        self.__longitude_label = tk.Label(
            self.__coordinates_frame,
            text="Longitude: ",
            font=("Courier", 12),
            background=colors.preview_backgorund_color,
            foreground=colors.main_font_color)

        # COUNTRY COMBOBOX
        self.__drop_countries = ttk.Combobox(
            self.__top_frame,
            values=self.__countries_names,
            textvariable=self.__act_country,
        )
        self.__act_country.set(self.__countries_names[0])
        self.__drop_countries.current(0)
    def __init__(self, master):
        master.title('Sample Messagebox')

        self.text = tk.Text(master, bg='white', font='Arial 20')
        self.text.pack(side='top', expand=True, fill='both')
Esempio n. 19
0
import matplotlib.pyplot as plt  #plotting graph
import matplotlib
import tkinter as tk
#import numpy as np
import math
import random
from matplotlib.pyplot import figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
figure(num=None, figsize=(18, 12), dpi=80, facecolor='w', edgecolor='k')

root = tk.Tk()
root.title("Realistic Approach")
text1 = tk.Text(root, height=40, width=100)

text1.pack()
# declaring variables
year = 2011
year_population = 6997990000
pop_inrease_rate = 0.012
e = 2.71828
yearlist = []
poplist = []
dislist = [
    "Global Warming", "An Asteroid Collision", "Global War",
    "A gamma ray burst", "A rogue black hole", "A giant solar flare",
    "A super volcano"
]
count = 0
e_count = 0

print(
Esempio n. 20
0
    def _build_show_logs_frame(self, parent):
        """Home window frame responsible for showing existing logs"""
        def get_logs():
            if self._show_all_logs_value.get():
                date = None
            else:
                date = date_picker.get_date()
            self._thread_pool.submit(self._gym_log_controller.get_logs, date) \
                .add_done_callback(update_display)

        def update_display(future):
            data = future.result()
            current_log_display.config(state='normal')
            current_log_display.delete('1.0', tk.END)
            if data:
                for row in data:
                    session = row['session']
                    date = datetime.datetime.strptime(
                        session['date'], "%a, %d %b %Y %H:%M:%S %z").date()
                    exercises = session['exercises']
                    reps = session['reps']
                    weights = session['weights']
                    current_log_display.insert(tk.END, str(date) + '\n')
                    for e, r, w in zip(exercises, reps, weights):
                        current_log_display.insert(tk.END,
                                                   '\t' + str(e) + ':\n')
                        current_log_display.insert(
                            tk.END, '\t\tweights: ' + str(w) + '\n')
                        current_log_display.insert(
                            tk.END, '\t\treps: ' + str(r) + '\n')
            else:
                current_log_display.insert(
                    tk.END, "There are no logs available for this date.")
            current_log_display.config(state='disabled')

        def show_logs(*args):
            get_logs()

        # define parent frame to hold widgets
        show_logs_frame = ttk.Frame(parent)

        # add date picker
        date_picker_frame = ttk.Frame(show_logs_frame)
        date_picker = DatePicker(date_picker_frame)
        date_picker_frame.grid(row=0, rowspan=3, column=2)

        # encapsulate window control buttons in their own frame
        button_frame = ttk.Frame(show_logs_frame)
        button_frame.grid(row=4, columnspan=3, pady=(10, 5))
        show_logs_button = ttk.Button(button_frame,
                                      text="Show logs",
                                      command=show_logs)
        show_logs_button.pack(side=tk.LEFT)
        show_all_logs_checkbox = ttk.Checkbutton(
            button_frame,
            text="Show all logs",
            variable=self._show_all_logs_value)
        show_all_logs_checkbox.pack(side=tk.LEFT)

        # encapsulate display to show logs
        display_frame = ttk.LabelFrame(show_logs_frame, text="Logs")
        display_frame.grid(row=5, columnspan=3, padx=10)
        current_log_display = tk.Text(display_frame,
                                      state='disabled',
                                      height=26)
        current_log_display.pack()

        return show_logs_frame
Esempio n. 21
0
                            text='生成複製文',
                            font=('微軟正黑體', 12),
                            width=30,
                            height=4,
                            command=generator)
    left_button.pack(side=tk.LEFT)
    right_button = tk.Button(top_frame,
                             text='建立資料庫',
                             font=('微軟正黑體', 12),
                             width=30,
                             height=4,
                             command=build_data)
    right_button.pack(side=tk.LEFT)

    # generator page
    generator_input = tk.Text(window)
    generator_output = tk.Text(window)
    generator_button = tk.Button(window,
                                 text='轉換',
                                 font=('微軟正黑體', 12),
                                 command=generate)

    # build data page
    builddata_key = tk.Entry(window, font=('微軟正黑體', 12))
    builddata_emoji = tk.Entry(window, font=('微軟正黑體', 12))
    builddata_button = tk.Button(window,
                                 text='儲存',
                                 font=('微軟正黑體', 12),
                                 command=save)
    key_label = tk.Label(window, text='關鍵字', font=('微軟正黑體', 12))
    emoji_label = tk.Label(window, text='表情', font=('微軟正黑體', 12))
Esempio n. 22
0
    def _build_add_log_frame(self, parent):
        """Home window frame responsible for adding new logs"""
        def set_button_states(*args):
            if self._exercise_name.get() and self._exercise_reps.get(
            ) and self._exercise_sets.get():
                add_log_button.state(['!disabled'])
            else:
                add_log_button.state(['disabled'])

            if self._logs:
                submit_logs_button.state(['!disabled'])
                reset_session_button.state(['!disabled'])
            else:
                submit_logs_button.state(['disabled'])
                reset_session_button.state(['disabled'])

        def add_log():
            name = self._exercise_name.get().title()
            sets = self._exercise_sets.get()
            weight = [self._exercise_weight.get()] * sets
            reps = [self._exercise_reps.get()] * sets
            if name in self._logs:
                self._logs[name]['weights'] += weight
                self._logs[name]['reps'] += reps
            else:
                self._logs[name] = {'weights': weight, 'reps': reps}
            update_display(False)

        def submit_logs():
            def check_for_409_response(future):
                if not future.result():
                    messagebox.showwarning(
                        "409 - Duplicate Content",
                        "A session for that date already exists")

            date = str(date_picker.get_date())
            self._thread_pool \
                .submit(self._gym_log_controller.add_logs, date, self._logs) \
                .add_done_callback(check_for_409_response)
            update_display()

        def update_display(reset_session=True):
            def update_current_log_display():
                current_log_display.config(state='normal')
                current_log_display.delete('1.0', tk.END)
                data = ''
                for name, log in self._logs.items():
                    data += name + ':\n'
                    data += '\tweights: ' + str(log['weights']) + '\n'
                    data += '\treps: ' + str(log['reps']) + '\n'
                current_log_display.insert('1.0', data)
                current_log_display.config(state='disabled')

            def clear_inputs():
                self._exercise_name.set('')
                self._exercise_weight.set(0)
                self._exercise_reps.set(0)
                self._exercise_sets.set(0)

            if reset_session:
                self._logs = {}
            update_current_log_display()
            set_button_states()
            clear_inputs()

        # define parent frame to hold widgets
        add_log_frame = ttk.Frame(parent)

        # encapsulate widgets to specify parameters for gym logs
        ttk.Label(add_log_frame, text="Exercise:").grid(row=0,
                                                        column=0,
                                                        sticky=tk.W)
        exercise_name = ttk.Combobox(add_log_frame,
                                     textvariable=self._exercise_name,
                                     state='readonly',
                                     values=self._gym_log_controller.exercises)
        exercise_name.grid(row=0, column=1, sticky=tk.E)
        exercise_name.bind('<<ComboboxSelected>>', set_button_states)

        def update_exercise_name_options():
            exercise_name['values'] = self._gym_log_controller.exercises

        self._gym_log_controller.subscribe(update_exercise_name_options)

        ttk.Label(add_log_frame, text="Weight:").grid(row=1,
                                                      column=0,
                                                      sticky=tk.W)
        exercise_weights = ttk.Spinbox(add_log_frame,
                                       from_=0,
                                       to=100,
                                       textvariable=self._exercise_weight,
                                       justify=tk.RIGHT)
        exercise_weights.grid(row=1, column=1, sticky=tk.E)

        ttk.Label(add_log_frame, text="Reps:").grid(row=2,
                                                    column=0,
                                                    sticky=tk.W)
        exercise_reps = ttk.Spinbox(add_log_frame,
                                    from_=0,
                                    to=100,
                                    textvariable=self._exercise_reps,
                                    justify=tk.RIGHT)
        exercise_reps.grid(row=2, column=1, sticky=tk.E)

        ttk.Label(add_log_frame, text="Sets:").grid(row=3,
                                                    column=0,
                                                    sticky=tk.W)
        exercise_sets = ttk.Spinbox(add_log_frame,
                                    from_=0,
                                    to=100,
                                    textvariable=self._exercise_sets,
                                    justify=tk.RIGHT)
        exercise_sets.grid(row=3, column=1, sticky=tk.E)

        for widget in (exercise_weights, exercise_reps, exercise_sets):
            widget.bind('<ButtonRelease-1>', set_button_states)
            widget.bind('<FocusOut>', set_button_states)
            widget.bind('<Return>', set_button_states)

        # add date picker
        date_picker_frame = ttk.Frame(add_log_frame)
        date_picker = DatePicker(date_picker_frame)
        date_picker_frame.grid(row=0, rowspan=3, column=2)

        # encapsulate window control buttons in their own frame
        button_frame = ttk.Frame(add_log_frame)
        button_frame.grid(row=4, columnspan=3, pady=(10, 5))
        add_log_button = ttk.Button(button_frame,
                                    text="Add log to session",
                                    command=add_log)
        submit_logs_button = ttk.Button(button_frame,
                                        text="Submit session",
                                        command=submit_logs)
        reset_session_button = ttk.Button(button_frame,
                                          text="Reset Session",
                                          command=update_display)
        for widget in (add_log_button, submit_logs_button,
                       reset_session_button):
            widget.pack(side=tk.LEFT)
            widget.state(['disabled'])

        # encapsulate display to show logs in current session
        session_frame = ttk.LabelFrame(add_log_frame, text="Session")
        session_frame.grid(row=5, columnspan=3, padx=10, pady=(0, 10))
        current_log_display = tk.Text(session_frame, state='disabled')
        current_log_display.pack()

        return add_log_frame
Esempio n. 23
0
        tah = result['trans_result'][0]['dst'].replace(
            '标记', ' ')  #.replace('标记', ' ')专用于PS3寒蝉鸣泣之时粹 如果是普通用途 请删去

    except Exception as e:
        print(e)
    finally:
        if httpClient:
            httpClient.close()

    yw.delete(0.0, 'end')
    fy.delete(0.0, 'end')
    yw.insert('end', crr + '\n')
    fy.insert('end', tah + '\n')

top = tk.Tk()
top.wm_attributes('-topmost', 1)  #窗口置顶
top.geometry('250x500')  #窗口默认大小设置
top.title("基于百度AI和百度翻译的屏幕文字实时翻译软件")  #窗口名
ft = tf.Font(family='微软雅黑', size=8)  #提醒框文字字体设置
ft1 = tf.Font(family='微软雅黑', size=12)  #文本框文字字体设置

bt = tk.Button(text='进行截图翻译', command=click)
bt.pack()
yw = tk.Text(top, width=40, height=10, font=ft1)  #原文
yw.pack()
fy = tk.Text(top, width=40, height=10, font=ft1)  #译文
fy.pack()
lab = tk.Label(top, text='已经进行了0次翻译', compound='left', font=ft)
lab.pack()

top.mainloop()
Esempio n. 24
0
tab3 = ttk.Frame(nb)
tab4 = ttk.Frame(nb)
nb.add(tab1, text='Interaction Info')
nb.add(tab2, text='New Wallet Info')
nb.add(tab3, text='Transaction History')
nb.add(tab4, text='Address Book')
nb.grid(row=3,
        column=0,
        rowspan=3,
        columnspan=2,
        sticky='NEWS',
        padx=(10, 10),
        pady=(5, 5))

# widgets creation
wallet_interact_messages = tk.Text(tab1, height=8, width=85, bg='gray22')
wallet_create_messages = tk.Text(tab2, height=8, width=85, bg='gray22')
transaction_history_messages = tk.Text(tab3, height=8, width=85, bg='gray22')
address_book_messages = ttk.Treeview(tab4,
                                     columns=('Name', 'Address'),
                                     show='headings',
                                     height=5)

get_new_address_button = ttk.Button(root, text="Get new address")
nspv_login_button = ttk.Button(root, text="Login")
nspv_logout_button = ttk.Button(root, text="Logout")
refresh_button = ttk.Button(root, text="Refresh")

# prices
price_text = ttk.Label(root, width=50)
price_change_text = ttk.Label(root, width=50)
Esempio n. 25
0
 def _create_widgets(self):
     self._text = tk.Text(self, wrap='char', state='disabled')
     self._scrollbar = ttk.Scrollbar(self, orient='vertical')
     self._text.configure(yscrollcommand=self._scrollbar.set)
     self._scrollbar.configure(command=self._text.yview)
Esempio n. 26
0
trackImg = tk.Button(window,
                     text="Detect Images",
                     command=TrackImages,
                     fg="red",
                     bg="yellow",
                     width=20,
                     height=3,
                     activebackground="Red",
                     font=('times', 15, ' bold '))
trackImg.place(x=800, y=500)
quitWindow = tk.Button(window,
                       text="Quit",
                       command=window.destroy,
                       fg="red",
                       bg="yellow",
                       width=20,
                       height=3,
                       activebackground="Red",
                       font=('times', 15, ' bold '))
quitWindow.place(x=1100, y=500)
copyWrite = tk.Text(window,
                    background=window.cget("background"),
                    borderwidth=0,
                    font=('times', 30, 'italic bold underline'))
copyWrite.insert("insert", "Developed by Team SB2K", "")
copyWrite.configure(state="disabled", fg="white")
copyWrite.pack(side="left")
copyWrite.place(x=800, y=750)

window.mainloop()
Esempio n. 27
0
image_label = tk.Label(root, image=photo)
image_label.place(x=0, y=0, relwidth=1, relheight=1)
image_label.bind('<Configure>', resize_image)

name_label = tk.Label(root,
                      text='Enter Card Name: ',
                      font=('calibre', 10, 'bold'))
name_label.pack(pady=20, padx=20)
name_entry = tk.Entry(root,
                      textvariable=name_var,
                      font=('calibre', 10, 'normal'))
name_entry.pack(pady=20)

frame = tk.Frame(root, relief='raised', borderwidth=2)
frame.pack(fill=tk.BOTH, expand=tk.YES)
frame.pack_propagate(False)

text = tk.Text(frame, width=120, height=10)
text.pack(pady=1)

# Buttons
actualizar_btn = tk.Button(frame,
                           text='Update Database',
                           command=Update_database)
actualizar_btn.pack(pady=20)
submit_btn = tk.Button(frame, text='Submit', command=Seeker)
submit_btn.pack(pady=20)
root.bind('<Return>', lambda event=None: submit_btn.invoke(
))  # Click submit by pressing Enter using lambda to doing it continuosly.

root.mainloop()
Esempio n. 28
0
 def __init__(self, root, isTKroot=True):
     className = self.__class__.__name__
     Fun.G_UIElementArray[className] = {}
     Fun.G_ElementBindingDataArray[className] = {}
     global ElementBGArray
     global ElementBGArray_Resize
     global ElementBGArray_IM
     Fun.AddElement(className, 'UIClass', self)
     self.root = root
     if isTKroot == True:
         root.title("Form1")
         root.geometry("454x410")
     Form_1 = tkinter.Canvas(root, width=10, height=4)
     Form_1.place(x=0, y=0, width=454, height=410)
     Form_1.configure(bg="#efefef")
     Fun.AddElement(className, 'root', root)
     Fun.AddElement(className, 'Form_1', Form_1)
     Group_1_Variable = Fun.AddElementVariable(className, 'Group_1')
     Group_1_Variable.set(1)
     #Create the elements of root
     Label_2 = tkinter.Label(root, text="", width=10, height=4)
     Label_2.place(x=50, y=0, width=100, height=100)
     ElementBGArray[2] = Image.open("ico.png")
     ElementBGArray_Resize[2] = ElementBGArray[2].resize((100, 100),
                                                         Image.ANTIALIAS)
     ElementBGArray_IM[2] = ImageTk.PhotoImage(ElementBGArray_Resize[2])
     Label_2.configure(image=ElementBGArray_IM[2])
     Label_2_Ft = tkinter.font.Font(family='System',
                                    size=24,
                                    weight='bold',
                                    slant='roman',
                                    underline=0,
                                    overstrike=0)
     Label_2.configure(font=Label_2_Ft)
     Fun.AddElement(className, 'Label_2', Label_2)
     Label_3 = tkinter.Label(root, text="注册信息", width=10, height=4)
     Label_3.place(x=150, y=34, width=206, height=45)
     Label_3_Ft = tkinter.font.Font(family='System',
                                    size=29,
                                    weight='bold',
                                    slant='roman',
                                    underline=0,
                                    overstrike=0)
     Label_3.configure(font=Label_3_Ft)
     Fun.AddElement(className, 'Label_3', Label_3)
     Label_4 = tkinter.Label(root, text="姓名", width=10, height=4)
     Label_4.place(x=53, y=111, width=100, height=20)
     Fun.AddElement(className, 'Label_4', Label_4)
     Entry_5_Variable = Fun.AddElementVariable(className, 'Entry_5')
     Entry_5 = tkinter.Entry(root, textvariable=Entry_5_Variable)
     Entry_5.place(x=175, y=110, width=120, height=20)
     Entry_5.configure(relief="sunken")
     Fun.AddElement(className, 'Entry_5', Entry_5)
     Label_6 = tkinter.Label(root, text="性别", width=10, height=4)
     Label_6.place(x=54, y=146, width=100, height=20)
     Fun.AddElement(className, 'Label_6', Label_6)
     RadioButton_7 = tkinter.Radiobutton(root,
                                         variable=Group_1_Variable,
                                         value=1,
                                         text="男",
                                         anchor=tkinter.W)
     RadioButton_7.place(x=173, y=147, width=48, height=20)
     Fun.AddElement(className, 'RadioButton_7', RadioButton_7)
     RadioButton_8 = tkinter.Radiobutton(root,
                                         variable=Group_1_Variable,
                                         value=2,
                                         text="女",
                                         anchor=tkinter.W)
     RadioButton_8.place(x=243, y=149, width=48, height=20)
     Fun.AddElement(className, 'RadioButton_8', RadioButton_8)
     Label_9 = tkinter.Label(root, text="邮箱", width=10, height=4)
     Label_9.place(x=54, y=181, width=100, height=20)
     Fun.AddElement(className, 'Label_9', Label_9)
     Entry_10_Variable = Fun.AddElementVariable(className, 'Entry_10')
     Entry_10 = tkinter.Entry(root, textvariable=Entry_10_Variable)
     Entry_10.place(x=175, y=185, width=195, height=20)
     Entry_10.configure(relief="sunken")
     Fun.AddElement(className, 'Entry_10', Entry_10)
     Label_11 = tkinter.Label(root, text="个人简介", width=10, height=4)
     Label_11.place(x=55, y=220, width=100, height=20)
     Fun.AddElement(className, 'Label_11', Label_11)
     Text_12 = tkinter.Text(root)
     Text_12.place(x=175, y=220, width=240, height=120)
     Text_12.configure(relief="sunken")
     Fun.AddElement(className, 'Text_12', Text_12)
     Button_13 = tkinter.Button(root, text="确定", width=10, height=4)
     Button_13.place(x=176, y=354, width=100, height=28)
     Button_13.configure(command=lambda: RegDlg_cmd.Button_13_onCommand(
         className, "Button_13"))
     Fun.AddElement(className, 'Button_13', Button_13)
     Button_14 = tkinter.Button(root, text="取消", width=10, height=4)
     Button_14.place(x=310, y=354, width=100, height=28)
     Button_14.configure(command=lambda: RegDlg_cmd.Button_14_onCommand(
         className, "Button_14"))
     Fun.AddElement(className, 'Button_14', Button_14)
     #Inital all element's Data
     Fun.InitElementData(className)
import tkinter as tk

root = tk.Tk()

output = tk.Text(root, background="blue", height=10, width=50)
output.config(state="disable")
output.grid(row=0, column=0, columnspan=2)

btnStat1 = tk.Button(root, text="stat 1")
btnStat1.grid(row=1, column=0)

btnStat2 = tk.Button(root, text="stat 2")
btnStat2.grid(row=2, column=0)

btnStat3 = tk.Button(root, text="stat 3")
btnStat3.grid(row=3, column=0)

root.mainloop()
                          fg="#999999",
                          text='Rename',
                          font=('Helvetica', 12),
                          command=renaming_number_sequence)
button_quit = tk.Button(frame_entries,
                        width=20,
                        highlightbackground="#222222",
                        bg="#222222",
                        fg="#999999",
                        text='Cancel',
                        font=('Helvetica', 12),
                        command=Cancel_quit)

text_display_directory = tk.Text(frame_directory,
                                 width=92,
                                 height=1,
                                 bg="#dddddd",
                                 highlightbackground="#222222",
                                 highlightthickness=3)
text_display_directory.config(state=DISABLED)

text_display_files = tk.Text(frame_file_old,
                             width=45,
                             height=15,
                             bg="#dddddd",
                             highlightbackground="#222222",
                             highlightthickness=6)
text_display_files.config(state=DISABLED)

text_display_newname = tk.Text(frame_file_new,
                               width=45,
                               height=15,