-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebsiteGUI.py
More file actions
45 lines (28 loc) · 987 Bytes
/
WebsiteGUI.py
File metadata and controls
45 lines (28 loc) · 987 Bytes
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
from tkinter import *
from tkinter import ttk
class Feedback:
def __init__(self, master):
master.title('Create Your Own Website')
self.style = ttk.Style()
self.frame_content = ttk.Frame(master)
self.frame_content.pack()
self.text = Text(self.frame_content, width = 50, height = 10, font = ('Arial', 10))
self.text.grid(row = 3, column = 0)
ttk.Button(self.frame_content, text = 'Create Web Page', command = self.submit).grid(row=1, column=0)
def submit(self):
bodyText = self.text.get(1.0, 'end')
web_page = '''<!DOCTYPE html
<html>
<body>
{0}
</body>
</html>'''.format(bodyText)
output = open("yourWebPage.html", "w")
output.write(web_page)
output.close()
def main():
root = Tk()
feedback = Feedback(root)
root.mainloop()
if __name__ == "__main__": main()
# label = ttk.Label(root, text = "Hello, Tkinter!")