# Day 11
# __ _ _ _ _ _ _ _
# / _\ |_ __ _ _ __| |_(_)_ __ __ _ | |_| | _(_)_ __ | |_ ___ _ __
# \ \| __/ _` | '__| __| | '_ \ / _` | | __| |/ / | '_ \| __/ _ \ '__|
# _\ \ || (_| | | | |_| | | | | (_| | | |_| <| | | | | || __/ |
# \__/\__\__,_|_| \__|_|_| |_|\__, | \__|_|\_\_|_| |_|\__\___|_|
# |___/
'''
# gui!
# use tkinter for gui
# it looks ass, but its what we are working with
from tkinter import *
# setup a window
window=Tk()
window.resizable(True, True) # needed to work with bspwm
window.title("bruh") # gives the window a title
window.geometry("400x400+200+200")
# all values are in pixels
# window geometry defines the size (height, width) and placement of it when opened (from top left corner)
def change_label():
label1.config(text="hellow world") # changes attributes of given wigits
# wigits:
# labels
label1=Label(window,
text = "this is a label",
foreground = "red",
font = ("Hack Nerd Font", 14)) # any font on your system | use a common one for assinments
label1.place(x=80, y=40)
# buttons
button1=Button(window,
text = "this is a button",
font = ("Bario", 14),
foreground = "blue",
command = change_label) # no extra brackets needed
button1.place(x=80, y=80)
mainloop() # for being resizable
# make program that translates somthing to four lanuages
# display giant random number
# show the anwser to riddle
'''
from tkinter import *
from tkinter.ttk import Notebook
import random
# window
window =Tk()
window.resizable(True, True)
window.title("Gui!")
window.geometry("400x400+200+200")
# tabs
notebook = Notebook(window) # for organizing
# part 1
part1 = Frame(notebook)
part1_header=Label(part1,
text = "translate hello into four lanuages",
font = ("Hack Nerd Font", 20))
part1_header.pack()
greeting = Label(part1,
text="Hello!",
font=("Hack Nerd Font", 30),
foreground = "red")
greeting.pack()
# these should be done with lambda functions, but the point is to show i can do this
def translate_english():
greeting.config(text = "Hello!")
def translate_spanish():
greeting.config(text = "Hola!")
def translate_french():
greeting.config(text = "Sault!")
def translate_mahooganna():
greeting.config(text = "Hoh!")
english=Button(part1,
text = "Translate to English",
font = ("Hack Nerd Font", 12),
command = translate_english)
english.pack()
spanish=Button(part1,
text = "Translate to Spanish",
font = ("Hack Nerd Font", 12),
command = translate_spanish)
spanish.pack()
french=Button(part1,
text = "Translate to French",
font = ("Hack Nerd Font", 12),
command = translate_french)
french.pack()
mahooganna=Button(part1,
text = "Translate to Mahooganna",
font = ("Hack Nerd Font", 12),
command = translate_mahooganna)
mahooganna.pack()
# _/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\__/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_
# part 2
part2 = Frame(notebook)
part2_header=Label(part2,
text = "HOLY SHIT BIG NUMBER",
font = ("Hack Nerd Font", 20))
part2_header.pack()
bignumber=Label(part2,
text = "num",
font = ("Hack Nerd Font", 100),
foreground = "blue")
bignumber.pack()
rollbutton=Button(part2,
text = "GET NEW NUMBER!!",
font = ("Hack Nerd font", 12),
command = lambda : bignumber.config(text = str(random.randint(10000,100000))))
rollbutton.pack()
# _/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\__/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_
# part 3
part3 = Frame(notebook)
part3_header=Label(part3,
text = "riddle show",
font = ("Hack Nerd Font", 20))
part3_header.pack()
riddle=Label(part3,
text = "How is the moon\nlike a dollar?",
font = ("helvetica", 25),
foreground = "green")
riddle.pack()
# button
answerbutton=Button(part3,
text = "show answer",
command = lambda : answer.pack()) # place answer on button press
answerbutton.pack()
answer=Label(part3,
text = "it has four quaters",
font = 14,
foreground = "purple")
# _/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\__/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_
# placing tabs
notebook.add(part1, text = "part 1")
notebook.add(part2, text = "part 2")
notebook.add(part3, text = "part 3")
notebook.pack() # organizes tab placement for me
mainloop()