How to wrap lines automatically in Python Spyder?

Viewed 11122

I'm new to Python. I'm using Spyder 4.0.1, Python 3.7. The Spyder built-in PEP-8 convention code style check returns error E501 (line too long). Although I set the vertical line and wrap lines, it still shows error for the long characters line. Pycharm would wrap lines automatically, but I cannot find any effective solution in Spyder. What should I do? Do I have to press Enter manually for the long line? Thanks.

3 Answers

In Windows Go To Tools->Preferences->Editor and select Wrap lines.

enter image description here

If you use mac, you need to go to Python on the left right corner then click on Preferences. enter image description here


Then go to Editor, and check Wrap lines. enter image description here

To turn on the Word Wrap feature, go to View > Toggle Word Wrap or click the Edit Display icon in the Code Editor toolbar (it's the second-to-last one on the right) and select Toggle Word Wrap. You can also set the program preferences to keep this feature on by default.

Related