Home » Python » Where to set maximum line length

Where to set maximum line length

Posted by: admin November 1, 2017 Leave a comment

Questions:

I am using PyCharm on Windows. I am not getting the settings to change the maximum line length to 79 characters. I see that it is 120 characters by default. Where can I change it to 79 characters? I searched in the settings but didn’t find.

Answers:

Here is screenshot of my Pycharm. Required settings is in following path: File -> Settings -> Editor -> Code Style -> General: Right margin (columns)

Pycharm 4 Settings Screenshot

Questions:
Answers:

For PyCharm 4

File >> Settings >> Editor >> Code Style: Right margin (columns)

suggestion: Take a look at other options in that tab, they’re very helpful

Questions:
Answers:

You can even set a separate right margin for HTML. Under the specified path:

File >> Settings >> Editor >> Code Style >> HTML >> Other Tab >> Right margin (columns)

This is very useful because generally HTML and JS may be usually long in one line than Python. 🙂