此代码生成错误:
import tkinter
from tkinter.font import Font, nametofont
default_font = Font.nametofont("TkDefaultFont")
错误是:
Traceback (most recent call last):
File "C:\__P\nametofont.pyw", line 4, in <module>
default_font = Font.nametofont("TkDefaultFont")
AttributeError: type object 'Font' has no attribute 'nametofont'
>>>
如何访问“nametofont”?