On Sunday, March 10, 2019 at 8:14:53 AM UTC-5, Edward K. Ream wrote:

> Pyzo's import structure seems unlikely to hinder using any of the code 
that I want to move into Leo.

As mentioned in the "Startup" section, there subtle differences between 
running pyzo.exe and running pyzo from a script.  Similar differences will 
affect pyzo's tools. The following fails when executed from Leo:

import pyzo.tools.pyzoFileBrowser 

The traceback is:

...
 File "C:/apps/pyzo/source\pyzo\tools\pyzoFileBrowser\tree.py", line 689, in 
<module>
    class PopupMenu(pyzo.core.menu.Menu):

AttributeError: module 'pyzo.core' has no attribute 'menu'

This is not too surprising. There are various relative imports in pyzo. 
Perhaps something like pyzo/__init__.py should be called first.  

My plan is to create a *startup shim* to handle such things. The goal is to 
use the pyzo tools without changing their sources.

On a happier note, the following work just fine from Leo, assuming that 
'<path to>/pyzo/source/pyzo' is in sys.path:

import pyzo #  Prints: "started our command server".
from pyzo import yoton

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to