From: Glen S. <gl...@en...> - 2001-08-09 22:28:49
|
On Thursday 09 August 2001 15:11, David Dunkle wrote: > I would like to be able to import a Python module but > not from a file. For example, I may want to store Python source > in an RDBMS and import it without the file system being involved. > > From Java I would do this with by writing a classloader as part of > my application. How can I do this with Jython? > > I realize that I could probably subclass PackageManager and roll > my own. Is there a better way? Has anyone already solved this > problem? > > thanks, > David There are three ways I can think of... 1) subclass PackageManager 2) write your own import function 3) (related to 2) query the database and then exec the string in the appropriate namespace -- Glen Starchman The Enabled Technology Group >+++++++++[<++++++++>-]<.>++++++ [<+++++>-]<-.+++++++..+++. |