[Python-ideas] Making Python more enterprise technology

Stephen J. Turnbull stephen at xemacs.org
Tue May 11 09:35:45 CEST 2010


alex23 writes:

 > If anyone can show me how I can run one python program and have it
 > modify the sys.stdout of an existing running python process without
 > explicitly coding the latter to allow for it, please, I'd love to be
 > enlightened.

It's easiest to think outside the box of modifying internals of a
python process from outside.  Specifically (as already mentioned),
suppose the python process is a webserver, or a persistent CGI server,
or something like that.  Then people who write application modules for
that process think of their module as "the program", even though in
our reality they are just data (well, a library) for the real process.
That "program" is loaded into the process using "import" as usual, and
can modify sys.stdout simply by assigning to it.

What that means to the architecture board is that they are going to
have to write up some coding standards about globals, when you can
create them, when you can touch them, what you can do when you do mess
with them, what kind of cleanup is required, and how and where you
must document all of the above when you do it.  I'm not at all
surprised that they throw up their hands and say "no, thanks".




More information about the Python-ideas mailing list