Linux - Linebreak in IPython

Hi, I'm new to Linux, and I really like the idea of ​​writing and testing python code in a shell. But my problem is how can I do line breaks in IPython. Every time I use (I think) a "normal" label shift + code entry is performed. Function keys are disabled and the keyboard layout works fine on my laptop, what could be the problem?

+8
python linux shell ipython line-breaks
source share
3 answers

Nothing is a problem. Python code is executed in turn.

If your code does not work when executing line by line, it should not work when loading from a file (assuming a “clean” environment in both cases).

+5
source share

I just found a solution posted by Kenneth Falk: IPython Transitions with ^ V ^ J

While editing a multi-line block, use Ctrl+V CTRL+J

+16
source share

If you want to perform line breaks, you end the line with the escape character \ , as in the Python file. Shift+Enter has no special meaning in ipython and, indeed, in most cases in the shell. This also doesn't really matter in Python.

It is of particular importance in some text editors and text editors, primarily LyX and LibreOffice, and, of course, on some websites (via a web browser).

+6
source share

All Articles