ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 01 Jan 2017 11:26:22 -0600How to copy code from Jupyter notebookhttps://ask.sagemath.org/question/36125/how-to-copy-code-from-jupyter-notebook/How do I copy code from a Jupyter notebook to paste it here? I cannot figure out a way to do it.
In the old sage notebook format you can get a text version of your code input output by clicking a 'text' button that is to the right of the 'worksheet' button. I find that very convenient when posting questions here.
But since Sage seems to be moving to the Jupyter notebook format from the old notebook format, I figured I better get used to the Jupyter notebook.
I'm running Sage in Virtualbox in Windows.
Thank you.Thu, 29 Dec 2016 13:52:50 -0600https://ask.sagemath.org/question/36125/how-to-copy-code-from-jupyter-notebook/Answer by omoplata for <p>How do I copy code from a Jupyter notebook to paste it here? I cannot figure out a way to do it.</p>
<p>In the old sage notebook format you can get a text version of your code input output by clicking a 'text' button that is to the right of the 'worksheet' button. I find that very convenient when posting questions here.</p>
<p>But since Sage seems to be moving to the Jupyter notebook format from the old notebook format, I figured I better get used to the Jupyter notebook.</p>
<p>I'm running Sage in Virtualbox in Windows.</p>
<p>Thank you.</p>
https://ask.sagemath.org/question/36125/how-to-copy-code-from-jupyter-notebook/?answer=36138#post-id-36138OK, I found out that this can be done using the %history magic function. For example,
%history -n -o 12-17
prints the inputs 12 to 17 with output, and I can copy from that. But the error messages don't get printed.Sun, 01 Jan 2017 11:26:22 -0600https://ask.sagemath.org/question/36125/how-to-copy-code-from-jupyter-notebook/?answer=36138#post-id-36138