2

I've recently installed Ipython version 7.0.1 and I can't figure how to continue writing code on the next line.

E.g. the following executes upon pressing enter after the print statement.

def greeting():
    print("hi")

My previous version would have given me an indented newline, and upon pressing enter again(leaving the prior line blank) would then execute. I could then continue to write code within the function such as:

def greeting():
    print("hi")
    lst = []
    return lst

As it stands, I am simply unable to enter the second version of my function into ipython because it executes after the print statement.

; and \ do not work.

E.g.

def greeting():
    print("hi")\


def greeting():
    print("hi");
Dave
  • 424
  • 3
  • 14
  • Do you mean adding an **empty** line? As far as I know, Ipython only executes that function definition if you enter an **empty** line? If so, just use a commented empty line. – Hoblovski Oct 23 '18 at 11:13
  • Did you use `sep="\n"` parameter in print? And try use `c-m` shortcut. – Omsl Oct 23 '18 at 11:17
  • Sorry, I've edited my post to clarify the issue I'm experiencing. – Dave Oct 23 '18 at 12:00
  • 1
    https://stackoverflow.com/questions/52912257/why-does-continuation-line-break-right-after-if-block-on-ipython - a known bug – hpaulj Oct 23 '18 at 16:27

1 Answers1

1

As of version 7.1.1 this issue appears to have been resolved. I was on version 7.0.1.

pip install ipython --upgrade
Dave
  • 424
  • 3
  • 14