jupyter_console icon indicating copy to clipboard operation
jupyter_console copied to clipboard

Add %% magic for multi line cells

Open tebeka opened this issue 8 years ago • 2 comments

Sometimes I'd like to have multi line cells, for example when running several matplotlib commands. The current hack is to use the %%time magic

In [6]: %%time
      : xs = np.linspace(-6, 6, 100)
      : plt.plot(xs, np.sin(xs), label='sin')
      : plt.legend()
      : 
CPU times: user 100 ms, sys: 4 ms, total: 104 ms
Wall time: 104 ms

However I think it'll be nice to have a %% magic (or %%cell) just for having multi line cells.

tebeka avatar Mar 27 '17 21:03 tebeka

@tebeka , I was thinking about this. Did you figure it out? this would be very helpful

alphaCTzo7G avatar Feb 19 '18 22:02 alphaCTzo7G

Typing Ctrl-O to insert a new line works for me. https://github.com/ipython/ipython/issues/2493#issuecomment-441208390

IMO this is a sensible feature request - but why not agree with Ipython on a common feature so that there is consistency?

bluss avatar May 29 '21 20:05 bluss