Quantcast
Channel: How to save the output of a cell in iPython notebook - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer by Ken for How to save the output of a cell in iPython notebook

%%capture cap captures different outputs of the current cell (depending on --no-stderr, --no-stdout, or --no-display options) and stores them in cap.The capture object cap is only created/updated at...

View Article



Answer by Laxmi Talawar for How to save the output of a cell in iPython notebook

%%capture cap --no-stderrprint("a")with open('output.txt', 'w') as f: f.write(str(cap))

View Article

Answer by Amit for How to save the output of a cell in iPython notebook

You have a typo, missing d in cap.stout. It should be cap.stdoutI tested the following and it worked fine. cap.show() also printed "stuff" and re-running the cell overwrote the file.%%capture cap...

View Article

How to save the output of a cell in iPython notebook

I would like to be able to save the TEXT output of an iPython notebook cell into a file on disk. I have 2 additional requirements/requests: be able to re-run the cell and overwrite my output with...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images