This might not be the best way to do it, but the following has worked for
me in the past.
The output to the REPL is produced using display() (I think), so you can
use the following to get the same kind of output as a string:
julia> buf = IOBuffer();
julia> td = TextDisplay(buf);
julia> display(td, [1,2,3]);
julia> str = takebuf_string(buf)
"3-element Array{Int64,1}:\n 1\n 2\n 3"
If some has a simpler version I'd be grateful to see it as well.
-- Mike
On Sunday, 29 June 2014 10:28:16 UTC+2, Stéphane Laurent wrote:
>
> These days I have experienced Yihui's runr package and this is indeed not
> very satisfactory yet.
> Do you know whether we can straightforwardly get in Julia, the console
> output as a ready-to-print character string, for example here:
>
> *julia> [1,2,3]*
> *3-element Array{Int64,1}:*
> * 1*
> * 2*
> * 3*
>
>
> I'd like to get:
>
>
> *"3-element Array{Int64,1}:\n 1\n 2 \n 3"*
>
>
>
>