-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLanguage.py
More file actions
111 lines (81 loc) · 3.52 KB
/
Language.py
File metadata and controls
111 lines (81 loc) · 3.52 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
from tkinter import *
import tkinter.font as tkfont
from Commands import Commands
class PseudocodeRunner:
def __init__(self): # Constructor
NAME = 'PseudocodeEditor'
self.root = Tk()
self.TITLEFONT = ('Quicksand', 30)
self.BODYFONT = ('Courier New', 15)
self.root.geometry('1500x800')
self.root.title(NAME)
#Value = input('Enter hex value: ')
self.root.config(background = '#118888')
self.CreateObjects()
self.commandManager = Commands(self.OutputArea)
self.root.mainloop()
def CreateObjects(self):
self.EditorTitleFrame = Frame(self.root,
width = 720,
height = 70)
self.EditorTitleFrame.place(x=20, y=20)
self.EditorTitle = Label(self.EditorTitleFrame,
text = "Editor",
font = self.TITLEFONT,
width = 720,
height = 70)
self.EditorTitle.place(relx = 0.5, rely = 0.5, anchor = CENTER)
self.EditorFrame = Frame(self.root,
width = 720,
height = 550,
bg = 'White')
self.EditorFrame.place(x=20, y=110)
self.InputArea = Text(self.EditorFrame,
font = self.BODYFONT)
self.InputArea.place(x=10, y=10, width=700, height=530)
font = tkfont.Font(font=self.InputArea['font'])
tab = font.measure(' ')
self.InputArea.config(tabs = tab)
self.TerminalTitleFrame = Frame(self.root,
width = 720,
height = 70)
self.TerminalTitleFrame.place(x=760, y=20)
self.TerminalTitle = Label(self.TerminalTitleFrame,
text = "Terminal",
font = self.TITLEFONT,
width = 720,
height = 70)
self.TerminalTitle.place(relx = 0.5, rely = 0.5, anchor = CENTER)
self.TerminalFrame = Frame(self.root,
width = 720,
height = 550,
bg = 'White')
self.TerminalFrame.place(x=760, y=110)
self.OutputArea = Text(self.TerminalFrame,
font = self.BODYFONT,
tabs = 4)
self.OutputArea.place(x=10, y=10, width=700, height=530)
self.RunButton = Button(self.root,
text = 'Run',
font = self.TITLEFONT,
fg = 'Green',
command = self.RunCode,
width = '38',
height = '2')
self.RunButton.place(x = 20, y = 680)
self.CloseButton = Button(self.root,
text = 'Close',
font = self.TITLEFONT,
fg = 'Red',
command = self.QuitWindow,
width = '38',
height = '2')
self.CloseButton.place(x = 760, y = 680)
def RunCode(self):
self.code = self.InputArea.get("1.0",END)
self.lines = self.code.split('\n')
self.commandManager.runCode(self.lines)
def QuitWindow(self):
self.root.quit()
if __name__ == "__main__":
Controller = PseudocodeRunner()