You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a render magic that renders output from subkernels as markdown, html etc. We could provide a capture magic to capture output from subkernels. Something like,
%capture --to var will capture the output (stdout) of subkernel to a variable var as string.
%capture --to var --as json would use json.load() to parse the output and return a dictionary. %capture --to var --as csv would use csv.read() to parse the output as pandas.DataFrame.
%capture --to var --as json --from outfile.txt would get the input from a file instead of standard output.
However, becaues capture and render are similar in functionality, we could add these features to the render magic. That is to say, we could add the following features to the render magic
--from outfile.txt get input from a file instead of stdout, assuming the file would be generated by the subkernel.
%render magic already supports JSON but we could add %render csv
--to var%render displays output as cell output but we could save the results to a file.
The text was updated successfully, but these errors were encountered:
Motivated by vatlab/sos#869
We have a
render
magic that renders output from subkernels as markdown, html etc. We could provide acapture
magic to capture output from subkernels. Something like,%capture --to var
will capture the output (stdout
) of subkernel to a variablevar
as string.%capture --to var --as json
would usejson.load()
to parse the output and return a dictionary.%capture --to var --as csv
would usecsv.read()
to parse the output aspandas.DataFrame
.%capture --to var --as json --from outfile.txt
would get the input from a file instead of standard output.However, becaues
capture
andrender
are similar in functionality, we could add these features to therender
magic. That is to say, we could add the following features to therender
magic--from outfile.txt
get input from a file instead of stdout, assuming the file would be generated by the subkernel.%render
magic already supportsJSON
but we could add%render csv
--to var
%render
displays output as cell output but we could save the results to a file.The text was updated successfully, but these errors were encountered: