[Tutor] Wrapping my head around global variables!!

Alan Gauld alan.gauld at btinternet.com
Sun Jan 30 23:40:53 CET 2011


"Nevins Duret" <duretn at bellsouth.net> wrote

> import tkinter.font
>
> When I try and  run this code, I get the error:
>
> |Traceback (most recent call last):
>   File "/home/neduret/pythonproj/alphabet3.py", line 21, in <module>
>     lgFont = tkinter.font(family = "HELVETICA", size = 200)
> TypeError: 'module' object is not callable|
>
>
> Now correct me if I'm wrong, but for whatever reason, is tkFont
> deprecated in Python3.1?  Well, this is why I used
>
> import tkinter.font instead.


tkinter.font is a module. As the error says you cannot call
the module.

You need to find out what object/function *inside* the module
does what you need. A case of reading the documentation
I suspect.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list