Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ipython. How to continue code on the next line?

Tags:

ipython

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");
like image 851
Dave Avatar asked Jan 21 '26 02:01

Dave


1 Answers

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

pip install ipython --upgrade
like image 142
Dave Avatar answered Jan 27 '26 01:01

Dave



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!