[IronPython] CreateScriptSourceFrom ... database?

Mark Grice markjoel60 at gmail.com
Thu Mar 4 17:04:29 CET 2010


Thanks for the reply. Actually, I did have an error in the string, and I
fixed that. But the real problem seems to be with the "Import" statement. I
put my common methods in a file that I then import into the various Python
script files.

It makes sense that the script would error, since, as a string, it doesn't
know how to handle the import.

It seems like the only way to go would be to replace the
PlatformAdaptionLayer class as you suggest -- but to be honest, I don't even
know where to begin with that.

Dino Viehland Wrote:

>Are the \r and \n getting escaped somehow?  There should be no problem if
the new lines are in the string the same as they would be in a file.
>Your solution generally sounds like the right and easy one to go with.  If
you wanted a more complicated solution you could replace the
PlatformAdaptionLayer class >with your own which would read "files" from the
database.  That would enable things like "import foo" to work where the user
could define a "foo" script in the database.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100304/584eef00/attachment.html>

More information about the Ironpython-users mailing list