PyEdit in Programming Python 2nd ed

Laura Lewin Laura_01 at MailAndNews.com
Wed May 2 10:31:31 EDT 2001


Hi,
As described in the book and CD's Examples\README-root.txt file, PYTHONPATH 
should include the directory that _contains_ the PP2E root directory, not 
PP2E 
itself.  Moreover, the directory that contains the PP2E directory copy must 
also include a file named __init__.py, because it is a package directory.  
That file can be empty, but it is required in PP2E's parent.  (The PP2E root 
directory is a Python modules package).

Cross-directory imports in book examples are always relative to the PP2E 
root.
 PyEdit, for example, says this to load menu/toolbar maker tools from 
elsewhere
in the examples directory tree:

    from PP2E.Gui.Tools.guimaker import *

So, the directory containing PP2E must be a package too, and should look 
like 
the top-level Examples directory on the CD.  In your case, if PP2E is copied 
from the CD to C:\PP2E, then two things probably need to be fixed:
 
1) The C: directory must be added to PYTHONPATH, not C:\PP2E
2) A C:\__init__.py file must exist, even if it's simply empty
 
If this still doesn't fix the problem, then perhaps the PyEdit source files 
have been altered locally. (Can you run PyEdit directly?)

Laura
LLewin at oreilly.com

>===== Original Message From "Fiel Cabral" <fscabral at bellsouth.net> =====
>Yes, I launched Launch_PyDemos.pyw first by double-clicking the
>"Launch_PyDemos" Python icon in Explorer and then at the DOS prompt by
>typing "python Launch_PyDemos.pyw".
>The launcher would appear and all of the scripts could display their GUI
>windows except PyEdit and PyView.
>I copied d:\Examples\PP2E to c:\PP2E and set PYTHONPATH to "C:\PP2E" then
>tried running from their but that didn't help PyEdit to appear.
>
>Yes, please share with me other options. Thank you.
>




More information about the Python-list mailing list