Method of inputting line feed in python interactive mode and and inputting multi line commands

  • 2021-07-09 08:27:11
  • OfStack

First, let's introduce the method of inputting line feed/multi-line command in python interactive mode

Wrap method\
Such as:
> > > print 'aaa'; \
... print 'bbb'; \
... print 'ccc'
Attention; The use of number.

python itself is unnecessary for statement ends and intervals; Number, but use it when wrapping lines; Number, the last line is not required; Number, plus can't go wrong.

ps: Let's look at how to wrap lines on the interactive command line of python

> > > Is the input prompt of python, and Enter is the end of input. So how to enter more than two statements

Wrap method\

Such as:


>>> print 'aaa'; \
... print 'bbb'; \
... print 'ccc'

Attention; The use of number. python itself is unnecessary for statement ends and intervals; Number, but use it when wrapping lines; Number, the last line is not required; Number, plus can't go wrong.

Summarize


Related articles: