Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions application.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import __main__
from tkinter import *
from tkinter import ttk


#! Function:

def motion_detection():
print('Motion Detection activated!')

def audio_lure():
print('Audio Lure has been set')

def silent_ventilation():
print('Silent Ventilation is active')
window.deiconify()

def quit():
print('You have quit!')
window.withdraw()

def action():
pass

def submit():

search_result = entry.get()

if(search_result == "MONETZ"):
print("You did right!")
else:
print("Not that one! Try again.")

#! Application:

#? Window
window = Tk()

window.geometry('420x420')
window.title("V.I.S.E. Application")
icon = PhotoImage(file='Python/Projects/gui/logo.png')
window.iconphoto(True,icon)
#window.config(background="#5cfcff") # HEX color also supportive


#? Internal variables
int_x = IntVar()
int_y = IntVar()


#? Menubar
menubar = Menu(window)
window.config(menu=menubar)

#* File Menu
fileMenu = Menu(menubar, tearoff=0, font=("Consolas", 15))
menubar.add_cascade(label="Menu", menu=fileMenu)
fileMenu.add_command(label="Motion Detection", command=motion_detection, compound='left')
fileMenu.add_command(label="Audio Lure", command=audio_lure, compound='left')
fileMenu.add_command(label="Silent Ventilation", command=silent_ventilation, compound='left')
fileMenu.add_separator()
fileMenu.add_command(label="Exit", command=quit, compound='left' )

#* Edit Menu
edit_menu = Menu(menubar, tearoff=0, font=("Consolas", 15))
menubar.add_cascade(label="Extra", menu=edit_menu)
edit_menu.add_command(label="Camera", compound='left')
edit_menu.add_command(label="Mic", compound='left')
edit_menu.add_command(label="Mute", compound='left')

#* Social Media Menu
# sm = social media
sm_menu = Menu(menubar, tearoff=0, font=("Consolas", 15))
menubar.add_cascade(label="Social Media", menu=sm_menu)
sm_menu.add_command(label="Telegram", compound='left')
sm_menu.add_command(label="X", compound='left')
sm_menu.add_command(label="LinkedIn", compound='left')


#? Notebook
notebook = ttk.Notebook(window)

tab1 = Frame(notebook) # new frame for tab 1
tab2 = Frame(notebook) # new frame for tab 2
tab3 = Frame(notebook) # new frame for tab 3

#? Entry
entry = Entry()
entry.pack()

submit = Button(window, text="Submit", command=submit)
submit.pack()





notebook.add(tab1, text="Motion Detection")
notebook.add(tab2, text="Audio Lure")
notebook.add(tab3, text="Silent Ventilation")
notebook.pack(expand=True, fill="both")

Label(tab1, text="Welcome to the 'Motion Detection' tool!", width=50, height=25).pack()
Label(tab2, text="Welcome to the 'Audio Lure' tool!", width=50, height=25).pack()
Label(tab3, text="Welcome to the 'Silent Ventilation' tool!", width=50, height=25).pack()


#? Button
action = Button(window, text='Action', command=action, font=("Consolas")).pack(side = RIGHT)
do = Button(window, text='Do', command=action, font=("Consolas")).pack(side = LEFT)





window.mainloop()

if __name__ == __main__:
print('this is the script area')
127 changes: 127 additions & 0 deletions calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
from tkinter import *

def button_press(num):

global equation_text

equation_text = equation_text + str(num)

equation_label.set(equation_text)

def equals():

global equation_text

try:
total = str(eval(equation_text))

equation_label.set(total)

equation_text = total

except ZeroDivisionError:

equation_label.set("arithmetic error")

equation_text = ""

except SyntaxError:

equation_label.set("syntax error")

equation_text = ""


def clear():

global equation_text

equation_label.set("")

equation_text = ""

window = Tk()
window.title("VISE's Calculator program")
window.geometry("500x500")

equation_text = ""

equation_label = StringVar()

label = Label(window, textvariable=equation_label, font=('consolas', 20), bg="white", width=24, height=2)
label.pack()

frame = Frame(window)
frame.pack()

button1 = Button(frame, text=1, height=4, width=9, font=35,
command= lambda: button_press(1))
button1.grid(row=0, column=0)

button2 = Button(frame, text=2, height=4, width=9, font=35,
command= lambda: button_press(2))
button2.grid(row=0, column=1)

button3 = Button(frame, text=3, height=4, width=9, font=35,
command= lambda: button_press(3))
button3.grid(row=0, column=2)

button4 = Button(frame, text=4, height=4, width=9, font=35,
command= lambda: button_press(4))
button4.grid(row=1, column=0)

button5 = Button(frame, text=5, height=4, width=9, font=35,
command= lambda: button_press(5))
button5.grid(row=1, column=1)

button6 = Button(frame, text=6, height=4, width=9, font=35,
command= lambda: button_press(6))
button6.grid(row=1, column=2)

button7 = Button(frame, text=7, height=4, width=9, font=35,
command= lambda: button_press(7))
button7.grid(row=2, column=0)

button8 = Button(frame, text=8, height=4, width=9, font=35,
command= lambda: button_press(8))
button8.grid(row=2, column=1)

button9 = Button(frame, text=9, height=4, width=9, font=35,
command= lambda: button_press(9))
button9.grid(row=2, column=2)

button0 = Button(frame, text=0, height=4, width=9, font=35,
command= lambda: button_press(0))
button0.grid(row=3, column=1)

plus = Button(frame, text='+', height=4, width=9, font=35,
command= lambda: button_press('+'))
plus.grid(row=0, column=3)

minus = Button(frame, text='-', height=4, width=9, font=35,
command= lambda: button_press('-'))
minus.grid(row=1, column=3)

multiply = Button(frame, text='*', height=4, width=9, font=35,
command= lambda: button_press('*'))
multiply.grid(row=2, column=3)

divide = Button(frame, text='/', height=4, width=9, font=35,
command= lambda: button_press('/'))
divide.grid(row=3, column=3)

equal = Button(frame, text='=', height=4, width=9, font=35,
command=equals)
equal.grid(row=3, column=2)

decimal = Button(frame, text='.', height=4, width=9, font=35,
command= lambda: button_press('.'))
decimal.grid(row=3, column=0)

clear = Button(window, text='clear', height=4, width=12, font=35,
command=clear)
clear.pack()



window.mainloop()
29 changes: 29 additions & 0 deletions clock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from tkinter import *
from time import *

def update():
time_string = strftime("%I:%M:%S %p")
time_label.config(text=time_string)

day_string = strftime("%A")
day_label.config(text=day_string)

date_string = strftime("%B %d, %Y")
date_label.config(text=date_string)

window.after(1000, update) # delay for 1000 milliseconds

window = Tk()

time_label = Label(window, font=("Arial", 50), fg="#00FF00", bg="black")
time_label.pack()

day_label = Label(window, font=("Ink Free", 25))
day_label.pack()

date_label = Label(window, font=("Ink Free", 30))
date_label.pack()

update()

window.mainloop()
21 changes: 21 additions & 0 deletions hide_show.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import tkinter as tk

def hide_window():
root.withdraw() # Скрыть окно

def show_window():
root.deiconify() # Показать окно

root = tk.Tk()
root.title("Пример с withdraw()")

# Кнопка для скрытия окна
hide_button = tk.Button(root, text="Скрыть окно", command=hide_window)
hide_button.pack(pady=20)

# Кнопка для восстановления окна
show_button = tk.Button(root, text="Показать окно", command=show_window)
show_button.pack(pady=20)

root.geometry("300x200")
root.mainloop()
Loading