-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcPrograms.py
More file actions
124 lines (96 loc) · 4.27 KB
/
cPrograms.py
File metadata and controls
124 lines (96 loc) · 4.27 KB
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
120
121
122
123
124
#Jesse A. Jones
#Version: 2023-08-14.90
from tkinter import *
import coinFlipGUI
import betterCToWarpConv
import connecFour
import chineseCalCalc
import gradeCalc
import calMonthDisplayGUI
import caesarCipher
import centaurianTime
import gradeCalcGUI
#Contains programs that start with the letter C in their Omniprogram titles.
class C(object):
def __init__(self, window = None):
self.window = window
self.soundsAllowed = False
#Top frame contains quit button.
self.frameTop = Frame(self.window)
self.frameTop.pack(side = TOP)
FONT = "Ariel 20"
#Quit button.
self.quitButton = Button(self.frameTop, text = "Quit",
font = FONT, command = self.quitButtonAction)
self.quitButton.pack()
#Bottom frame contains all buttons
# for programs that start with the letter C.
self.frameBottom = Frame(self.window)
self.frameBottom.pack(side = BOTTOM)
self.flipButton = Button(self.frameBottom, text = "Coin Flipper",
font = FONT, command = self.coinFlipper)
self.flipButton.grid(row = 0, column = 0)
self.CButton = Button(self.frameBottom, text = "C to Warp Converter",
font = FONT, command = self.CToWarp)
self.CButton.grid(row = 0, column = 1)
self.connecButton = Button(self.frameBottom, text = "Connect Four",
font = FONT, command = self.connecFour)
self.connecButton.grid(row = 0, column = 2)
self.chiButton = Button(self.frameBottom, text = "Chinese Year Calculator",
font = FONT, command = self.chineseCalc)
self.chiButton.grid(row = 1, column = 0)
self.grdButton = Button(self.frameBottom, text = "Calculate Weighted Grade",
font = FONT, command = self.grdCalc)
self.grdButton.grid(row = 1, column = 1)
self.calButton = Button(self.frameBottom, text = "Calendar Month Displayer",
font = FONT, command = self.mnthCalc)
self.calButton.grid(row = 1, column = 2)
self.caeButton = Button(self.frameBottom, text = "Caesar Cipher",
font = FONT, command = self.caesarCode)
self.caeButton.grid(row = 2, column = 0)
self.cenButton = Button(self.frameBottom, text = "Centaurian Time",
font = FONT, command = self.centaurian)
self.cenButton.grid(row = 2, column = 1)
self.gradeMarkII = Button(self.frameBottom, text = "Calculate Weighted Grade GUI Edition",
font = FONT, command = self.guiGrade)
self.gradeMarkII.grid(row = 2, column = 2)
#Quits the program.
def quitButtonAction(self):
self.window.destroy()
#Displays the result of a coin flip.
def coinFlipper(self): #DONE (maybe add head and tails counter later)
coinFlipGUI.main()
#Converts a multiple of the speed of light
# to the Star Trek TNG Warp Drive Scale.
def CToWarp(self):
betterCToWarpConv.main()
#Runs a GUI connect four game with several bells and wistles.
# The sound is currently a bit broken and needs to be fixed.
def connecFour(self):
connecFour.main()
#Converts a year to the equivalent year in the Chinese Calendar.
def chineseCalc(self):
chineseCalCalc.main()
#Calculates a grade from weighted grade portions. This is not a GUI.
def grdCalc(self):
gradeCalc.main()
#Displays a calendar month page for a given year and month.
# Is kind of garbage and could use improving.
def mnthCalc(self):
calMonthDisplayGUI.main() #DONE (DISPLAY STUFF IS STILL WONKY)
#Performs the classic Caeser Cipher encrption or decryption on a string.
def caesarCode(self):
caesarCipher.main()
#Displays the present Centaurian time that m.i.b Headquarters uses.
def centaurian(self):
centaurianTime.main()
#Calculates a grade from weighted grade portions.
def guiGrade(self):
gradeCalcGUI.main()
def main():
root = Tk()
root.title("Programs That Start With C")
om = C(root)
root.mainloop()
if __name__ == "__main__":
main()