Skip to content

Instantly share code, notes, and snippets.

View Ved-programmer's full-sized avatar
🎯
Focusing

Ved Rathi Ved-programmer

🎯
Focusing
View GitHub Profile
@Ved-programmer
Ved-programmer / Compact Calculator.py
Last active October 26, 2023 04:25
Compact Calculator by Ved The Pro
from tkinter import *
from math import *
root, WIDTH, HEIGHT = Tk(), 872, 630
root.geometry(f"{WIDTH}x{HEIGHT}");root.title("Ved The Pro Calculator")
calculationStringFrame = Frame(root);calculationStringFrame.place(x = 0, y = 0, width = WIDTH, height = 100)
calculationOutput = Label(calculationStringFrame, bg = "black", fg = "yellow", text = "", font = ("", 50));calculationOutput.pack(fill = X)
calcButtons = Frame(root);calcButtons.place(x = 0, y = 100)
buttonLayout = [["+", "-", "*", "/"], ["1", "2", "3", "4"], ["5", "6", "7", "8"], ["9", "0", "=", "b"], ["c", "factorial", "**", ","], ["(", ")", "lcm", "gcd"]]
buttonFuncLayoutString = ""
for i in buttonLayout:
import pygame as pg
import time, random
pg.init()
white = [255, 255, 255];black = [0, 0, 0];red = [255, 0, 0];green = [0, 155, 0];blue = [0, 0, 255];grey = [0, 255, 255] #Colors follow the RGB pattern
displayWidth, displayHeight = 800, 600 #Change this to change the dimensions of the screen
gameDisplay = pg.display.set_mode((displayWidth, displayHeight))
pg.display.set_caption("Slither") #Change the "Slither" to your wish