Sorry I should have been more clear..The script generate many many
lines of prints, and the results are nested among many classes and
functions that get called, so it'd be difficult to do a simple return
Response() to capture all of the output generated.

Hopefully that makes sense, unless I'm missing something obvious.

On Jul 2, 2:31 pm, "Garland, Ken R" <[EMAIL PROTECTED]> wrote:
> simple pylons output can be done like so:
>
> return Response(something)
>
> that would show hello on the website. If you wanted some output from a
> script just put the code of the script inside an action and when it
> comes time to return the output instead of using print use the return
> response.  If your objective was to do something like:
>
> print "hello"
>
> then do this instead:
>
> return Response("hello")
>
> but if you want to return the contents of some variable then use the
> example at the beginning of my message.
>
> On 7/2/07, Brian <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello,
>
> > I'm new to pylons and have been trying to figure this out but not
> > having much luck.
>
> > I have a set of existing python scripts that 'print' output to the
> > screen when you run them.  What's the easiest way to convert these
> > scripts such that they can be called from within a pylon controller
> > and have the output sent to a webpage?
>
> > I should note that this library of existing scripts is quite large,
> > and attempting to modify them (ie change prints to something else)
> > would be a bit of work.  I DID attempt to go the route of making a
> > controller return a generator that invokes my initial function,
> > however this quickly turned into a mess since generators may not
> > 'return' values, and many of the classes used in these scripts
> > regularly return values and results of function calls.
>
> > I'm almost wonder if launching my script via another thread and piping
> > the output to a file, and having a generator do a 'tail' of sorts on
> > the resulting file and do 'yields' is the best/only way?
>
> > Any ideas or examples on something similar?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to