Forums

Line wrapping in IPython notebooks

Hello,

I'd like to know if there's a way to wrap lines in IPython notebooks.

I have seen this answer https://stackoverflow.com/a/39398949 on a StackOverflow question but could not reproduce here on PA since I guess I don't have full access to IPython configuration.

As always, I'm probably missing something: What should I do?

Thanks in advance!

We don't really have a solution for that. However, I believe that having a tool like the notebook automatically wrap lines will generally make your code look very different to the code that is being executed and can lead to confusion. If you format your code so that it wraps the way you want it to, then you know you're executing the code that you're actually looking at. This is particularly true for a language like Python where whitespace is meaningful.