Monday, May 3, 2010

In python beyond 'exec string' is there a way to 'import' using the db as a filesystem

Programmer Question


Although it does not seem possible, I wanted to put this out there to see if others had some innovative solutions to 'dynamically loading and executing code in python'



So if one saved code in a database, one could read it and 'exec it', however if one wanted to use it in a similar fashion to the filesystem, one would need to




  1. 'save and load the compiled .pyc'

  2. create an 'import dbimp' ala 'import imp' etc.



any pointers? ideas? thoughts?





Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails