Re: Multi-line string extension
Steven D. Majewski (firstname.lastname@example.org)
Mon, 2 May 1994 20:02:51 -0400
On May 2, 16:37, Bill Janssen wrote:
> "Steven D. Majewski"@elv (4033)
> > Maybe better that either of those, would be to make Python
> > "html-smart". Define a tag for python code, and if the file
> > begins with a bracketed html code, skip to the python-code
> > section. However, this doesn't work with unix
> > "#!/usr/local/bin/python" executables.
> More in like with the WWW philosophy would be to new MIME (RFC 1521)
> types, say MULTIPART/PYTHON and APPLICATION/PYTHON. The
> MULTIPART/PYTHON would contain both APPLICATION/PYTHON and other parts,
> such as APPLICATION/POSTSCRIPT (already defined).
> Or instead of MULTIPART/PYTHON, use MULTIPART/ALTERNATIVE along with
> The python interpreter would look at the first line (second line if the
> first is #!/something/python), and if it was ``Content-Type:
> MULTIPART/ALTERNATIVE'', would then scan looking for instances of
> APPLICATION/PYTHON, and executing them. Viewers such as Xmosaic could
> also present the file properly, presenting the HTML or Postscript part
> of the document.
Yes. The ideal for me would be if python could import a multi-part
document of some type: either MIME or SGML/html would be acceptable
( or both? ), and look for a python-code portion.
It could either ignore the rest, or possibly, have some hooks for
turning the rest of the parts into string-objects. ( This latter
would be a convenience, but not absolutely necessary, as the function
objects have back pointers to the file they were defined in, so it
would be possible to parse the file afterwards. But as long as the
import would have to minimally parse it into chunks, it might just
as well deliver those chunks to you. )
Considering all of the multi-media research at cwi, I would think they
could find a use for this.
- Steve Majewski (804-982-0831) <sdm7g@Virginia.EDU>
- UVA Department of Molecular Physiology and Biological Physics
[ I did NOT graduate from Antioch-Columbia! ... Did anybody ? ]