I have 2 frames in a column. The top frame should fill
import Tkinter as tk
if __name__ == "__main__":
root = tk.Tk()
top_frame = tk.Frame(root, height=50, bg="blue")
top_frame.pack(anchor="n", fill="x", expand=True)
bot_frame = tk.Frame(root, bg="red")
bot_frame.pack(anchor="n", fill="both", expand=True)
fill are completely independent of each other.
expand answers the question "do I get extra space?", and
fill answers the question "how do I use the extra space that was given to me?".
So, you have two frames both of which have
expand=True. That means that tkinter will give half of the extra space to one frame, and half the extra space to the other, regardless of how those widgets plan to use the extra space.
Since the top frame only fills in the X direction, the extra space it has been given in the Y direction goes unused. That is why it appears gray below the defined height of the frame.
The solution to this specific problem is to have
expand be false for the top frame because you do not want it to be given extra space.