# -*- coding: utf-8 -*-
from Tkinter import *
# import ttk
import datetime

def save_diary():
	diary = InputBox.get("1.0",'end') +"\n\n"
	now = datetime.datetime.now().__format__('%c')+"\n"
	HistoryBox.insert(END, now)
	HistoryBox.insert(END, diary)
	InputBox.delete(1.0, END)
	file = open("DiaryPool.txt","a")
	file.write (now)
	file.write(diary)
	file.close()

root = Tk()
root.title("Dear Diary")


HistoryBox = Text(root, width=40, height=10)

file = open("DiaryPool.txt")
show_text = file.read()
file.close()

HistoryBox.insert(END, show_text)
HistoryBox.pack({"side": "top"})


InputBox = Text(root, width=40, height=10)
InputBox.pack({"side": "top"})

SAVE = Button(root)
SAVE["text"] = "Save"
SAVE["fg"] = "red"
SAVE["command"] = save_diary
SAVE.pack({"side": "bottom"})


	# file = open("DiaryPool.txt","a")
	# 	file.write (datetime.datetime.now().__format__('%c')+"\n")
	# 	file.write(self.word.get("1.0",'end')+"\n\n")
	# 	self.show_text.set(self.get_history())
	# 	file.close()
root.mainloop()
@@ -398,40 +398,146 @@
 %22)%0A%0A
-%0AHistoryBox = Text(root, 
+frame_top = Frame(width=350, height=200, bg='white')%0Aframe_middle = Frame(width=350, height=180, bg='white')%0Aframe_bottom = Frame(
 width=
-4
+35
 0, h
@@ -546,13 +546,43 @@
 ght=
-1
+4
 0)%0A%0A
+HistoryBox = Text(frame_top)%0A%0A
 file
@@ -682,115 +682,37 @@
 xt)%0A
-HistoryBox.pack(%7B%22side%22: %22top%22%7D)%0A%0A%0AInputBox = Text(root, width=40, height=10)%0AInputBox.pack(%7B%22side%22: %22top%22%7D
+%0AInputBox = Text(frame_middle
 )%0A%0AS
@@ -724,20 +724,28 @@
  Button(
-root
+frame_bottom
 )%0ASAVE%5B%22
@@ -812,249 +812,281 @@
 ary%0A
-SAVE.pack(%7B%22side%22: %22bottom%22%7D)%0A%0A%0A%09# file = open(%22DiaryPool.txt%22,%22a%22)%0A%09# %09file.write (datetime.datetime.now().__format__('%25c')+%22%5Cn%22)%0A%09# %09file.write(self.word.get(%221.0%22,'end')+%22%5Cn%5Cn%22)%0A%09# %09self.show_text.set(self.get_history())%0A%09# %09file.close
+%0Aframe_top.grid(row=0, column=0, padx=4, pady=5)%0Aframe_middle.grid(row=1, column=0, padx=4, pady=5)%0Aframe_bottom.grid(row=2, column=0)%0Aframe_top.grid_propagate(0)%0Aframe_middle.grid_propagate(0)%0Aframe_bottom.grid_propagate(0)%0A%0AHistoryBox.grid()%0AInputBox.grid()%0ASAVE.grid
 ()%0A
+%0A
 root

Add frame to control window