r/IPython • u/jabbalaci • May 24 '17
export as a normal Python session
Can we export the current session as if we had worked in the default Python shell? Here is what I mean. IPython session:
In [1]: li = [1, 2, 3]
In [2]: li
Out[2]: [1, 2, 3]
In [3]:I want to paste it in a blog post, but it's too verbose (imagine that it's longer). I'd like to export it like this:
>>> li = [1,2,3]
>>> li
[1, 2, 3]
>>>Is it possible?
1
Upvotes
1
u/jabbalaci May 24 '17
OK, found it:
is the closest.
1
u/NomadNella May 24 '17
1
u/tuck5649 May 24 '17
You could save space by combining that into one iPython line
1
u/NomadNella May 24 '17
You can convert it to a notebook and export it to html from there.
1
u/NomadNella May 24 '17
You can look over the magic commands and one of those could fit the bill.