From: <bc...@wo...> - 2001-01-29 13:56:51
|
[Brad Clements] >I have 3 python modules > >a.py, b.py and c.py > >b.py has > >from c import C > >I use jythonc with --package com.MurkWorks.FTPD > >The Java app can instantiate com.MurkWorks.FTPD.b okay. > >But when b tries to import class C from module c, it fails with > >importerror: cannot import name c > >-- > >So then I tried changing b.py to use > >from com.MurkWorks.FTPD.c import C > >This also fails with a similar import error. > >What's the proper method for multiple modules to load each other when >compiled with the --package option? There isn't any at the moment. The --package option is currectly most usefull when using the --deep option. That way the compiler knows that module "c" is in fact found as com.MurkWorks.FTPD.c. When you try to use from com.MurkWorks.FTPD.c import C you are hit by the problem that python modules can't be found as java classes in simple directories, only as modules in python packages (a directory with an __init__ module). regards, finn |