Python implementation of "include"
lloyd at paisite.com
lloyd at paisite.com
Thu Dec 13 14:50:20 EST 2007
Hello,
I've been using the
Python-based Karrigell web application framework. It has the very handy
word "include" that inserts a code file into into the stream of
execution. E.g. if myFile.py contains the code:
print "This is a message from myFile.py<br>"
and my script is:
print "Something<br>"
include "myFile.py"
print "Something more<br>"
The output would be:
Something
This is a message from myFile.py
Something more
Since
I'm considering moving my application to a different web application
framework, I'd like to replace include with a pure python construct.
I've discovered several ways to do it, but they all seem kludgy in one
way or another. Is there a simple, elegant way to do this?
Many thanks,
Lloyd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071213/a8ad7195/attachment.html>
More information about the Python-list
mailing list