''' Tkinter教程之Font篇 ''' # Tkinter中其它常用的一些功能 ''' 1.字体使用 ''' # -*- coding: cp936 -*- # 改变组件的显示字体 from Tkinter import * root = Tk() # 创建一个Label for ft in ( ' Arial ' ,( ' Courier New ' ,),( ' Comic Sans MS ' ,), ' Fixdsys ' ,( ' MS Sans Serif ' ,),( ' MS Serif ' ,), ' Symbol ' , ' System ' ,( ' Times New Roman ' ,), ' Verdana ' ): Label(root,text = ' hello sticky ' ,font = ft ).grid()root.mainloop() # 在Windows上测试字体显示,注意字体中包含有空格的字体名称必须指定为tuple类型。 ''' 2.使用系统已有的字体 ''' # -*- coding: cp936 -*- # Font来创建字体