我代码实现是:
# 设备SN
self.lab_sn = Label(frame, text="设备SN:", fg="black", font=("宋体", 18, "normal"), justify="left")
self.lab_sn.grid(row=3, column=2, rowspan=1, sticky=W)
self.lab_sn_show = Text(frame, width=22, height=1, bd=3, wrap=WORD, bg="WhiteSmoke", font=("宋体", 18, "bold"))
self.lab_sn_show.grid(row=3, column=2, rowspan=1, sticky=E)
# 设备ID
self.lab_id = Label(frame, text="设备ID:", fg="black", font=("宋体", 18, "normal"), justify="left")
self.lab_id.grid(row=5, column=2, rowspan=1, sticky=W)
self.lab_id = Text(frame, width=22, height=1, bd=3, wrap=WORD, bg="WhiteSmoke", font=("宋体", 18, "bold"))
self.lab_id.grid(row=5, column=2, rowspan=1, sticky=E)