Where is font 'nametofont' in python33?
Question: This code generates an error:

    
    
    import tkinter
    from tkinter.font import Font, nametofont
    
    default_font = Font.nametofont("TkDefaultFont")
    

The error is:

    
    
    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'
    >>>
    

How do I get access to 'nametofont'?


Answer: Ok, I figured out what I needed. Here is the modified and working code, with
an added print statement:

    
    
    from tkinter import Tk
    from tkinter.font import Font, nametofont
    
    root = Tk()
    default_font = nametofont("TkDefaultFont")
    print(default_font)
    

The `Font.nametofont(...)` needed to be just `nametofont(...)`, and then it
needed the `TK()` to get a window context to look in.

