|
From: David G. <go...@us...> - 2002-09-13 22:25:16
|
Aahz wrote:
> Well, suppose I've got the following Python code::
>
> print "Hello, world!"
>
> I'm going to want to include both::
>
> print "Hello, world!"
>
> and::
>
> Hello, world!
>
> Thus, there needs to be a directive to *run* the Python code and
> capture stdout (and/or stderr), probably as some kind of literal
> block.
I see. You want a directive that does the equivalent of
``os.system()``, and inserts the output into the document. Hmmm.
Seems dangerous to me, to embed system calls in a document. Perhaps
that should be left outside of the document, in the user's production
system (a makefile or a script or whatever)? Or, the directive could
be disabled by default and only enabled with an explicit command-line
option or config file setting. Even then, an interactive prompt may
be useful, such as:
The file.txt document you are processing contains a "system"
directive requesting that the ``sudo rm -rf /`` command be
executed. Allow it to execute? (y/N)
--
David Goodger <go...@us...> Open-source projects:
- Python Docutils: http://docutils.sourceforge.net/
(includes reStructuredText: http://docutils.sf.net/rst.html)
- The Go Tools Project: http://gotools.sourceforge.net/
|