Skip to content
Prev 8050 / 398506 Next

putting output from print() into a string?

Uwe Ligges <ligges at statistik.uni-dortmund.de> writes:
I don't think that was what David was looking for. If you really want
to postprocess the printed output, the sink-then-scan method would
seem to be the way to do it (or the soon-to- be readLines() instead of
scan()). I suppose that a sink(text=...) could be implemented, but
AFAIK it is not on anyones TODO list. 

One obvious counterquestion is "Why?". It would normally be preferable
to retrieve information from the object itself rather than the printed
representation, which is generally lossful in a number of ways.