Closed ufechner7 closed 3 years ago
Hi @ufechner7
The problem is that show
prints in stdout
instead of returning a value. Thus, pager
receives nothing
, which is returned by show
. I need to think how to make this easier (maybe I will create a macro...). Until then, you need to convert to string manually if you want to print Data Frames using custom options:
julia> sprint(io->(show(io, df1, truncate = 100)), context = :color => true) |> pager
Until I find a better solution, I think I add a "OK" feature to accomplish this. Now we have a macro @stdout_to_pager
that shows the stdout
output inside a pager. Hence, you can do:
julia> @stdout_to_pager show(df, truncate = 1000)
It works with any function that prints to stdout
.
julia> @stdout_to_pager for i = 1:1000
println(i)
end
The following code is not working correctly:
The output is:
Any idea?