Newbie question

Laura Creighton lac at strakt.com
Sat Dec 14 23:43:30 EST 2002


> I am completely new to Python.  This is probably a stupid question, so please
>  humor me.

This is not a stupid question.  PMW does not come standard with Python.
You need to get it here: http://pmw.sourceforge.net/

Your problem is almost certainly that your PYTHONPATH doesn't contain
wherever you put your PMW, since you didn't mention PYTHONPATH once
by the way. Python must just find the path (/Pmw  is typical) and
the __init__ file in that path. The error message "Cannot find module
Pmw" is very misleading here.

If you still have problems, go to http://pmw.sourceforge.net/ and
click on 'Getting Started With PMW'.

It is very important to know that Grayson did not write any of that
nice documentation for every PMW widget.  Greg McFarlane, the author
of PMW did that.  You'd never know from Python and Tkinter Programming
since he makes no mention of the fact, nor even thanks Greg for _writing_
PMW in the first place.  The more up to date PMW documentation lives
on sourceforge, and pleanty has changed since Grayson swiped a copy.

> I have two Python books, _Core Python Programming_ by Chun and _Python and Tk
> inter _Programming_ by Grayson.  I also downloaded a trial copy of the Wing I
> DE.  After correcting some indentation errors, I have been able to run the fi
> rst example in Grayson's book, calc1.py.  But when I try to run calc2.py, it 
> complains that it cannot find the modudle Pmw.  Pmw stands for Python Meta-wi
> dgets.  The Core Python Programming book seems to indicate that Python needs 
> to find a file called Pmw.py (page 384, section 12.2).  But when I search for
>  the file, I can't find it.  I find dozens of related files, with names like 
> pmw_labeled_widget.py and PmwButtonBox.py, but there appears to be no plain v
> anilla Pmw.py.
> 
> So there are two questions really: 1) If anyone has used the examples out of 
> _Python and Tkinter Programming_, how did you do it? ... and 2) Is there a we
> b page or something that explains everything I need to know about how Python 
> finds modules?

 Then you need to read this: http://effbot.org/guides/import-confusion.htm
(Go bookmark the rest of the effbot's Guides, eventually you will need
 them too, if not to understand yourself, to teach you how to explain
 these things to the next person you show Python).  But it doesn't
 tell you about PYTHONPATH. 

> 
> Best regards,
> Jive
> -- 
> http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list