font 样式有:normal 、 bold 、 roman 、 italic 、 underline 、 overstrike
# font 样式效果展示
from tkinter import *
root = Tk()
fontvalue = ['normal','bold','roman','italic','underline','overstrike']
for i in range(6):
Message(root,
text=fontvalue[i]+' \n'+'hello Python!',
width=300,
font=('Arial',10,fontvalue[i])
).pack(pady=5)
![](https://img.haomeiwen.com/i27912340/9f6e017411e64d10.png)
网友评论