import tkinter as tk
from tkinter import ttk
win=tk.Tk()
win.geometry('450x500')
tab=ttk.Notebook(win)
frame1=tk.Frame(tab,bg='red')
tab1=tab.add(frame1,text = "第一部分")
frame2 = tk.Frame(tab, bg = "blue")
tab2 = tab.add(frame2, text = "第二部分")
frame3= tk.Frame(tab, bg = "green")
tab3 = tab.add(frame3, text = "第三部分")
tab.pack(expand = True, fill = tk.BOTH)
win.resizable(0, 0)
win.mainloop()