Dave
Dave

Reputation: 454

Ipython. How to continue code on the next line?

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");

Upvotes: 3

Views: 2465

Answers (1)

Dave
Dave

Reputation: 454

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

pip install ipython --upgrade

Upvotes: 2

Related Questions