The Python Oracle

How do I set the maximum line length in PyCharm?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Industries in Orbit Looping

--

Chapters
00:00 Question
00:28 Accepted answer (Score 561)
00:49 Answer 2 (Score 76)
01:34 Answer 3 (Score 25)
01:57 Answer 4 (Score 8)
02:29 Thank you

--

Full question
https://stackoverflow.com/questions/1731...

Accepted answer links:
[image]: https://i.stack.imgur.com/V3BLg.png

Answer 2 links:
[image]: https://i.stack.imgur.com/tQVsX.png

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pycharm #pep8

#avk47



ACCEPTED ANSWER

Score 603


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




ANSWER 2

Score 83


For PyCharm 2018.1 on Mac:

Preferences (+,), then Editor -> Code Style:

enter image description here

For PyCharm 2018.3 on Windows:

File -> Settings (Ctrl+Alt+S), then Editor -> Code Style:

To follow PEP-8 set Hard wrap at to 80.




ANSWER 3

Score 25


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




ANSWER 4

Score 8


For anyone, or myself if I reload my machine, who this is not working for when you do a code reformat there is an additional option to check under editor->code style->python : ensure right margin is not exceeded. Once this was selected the reformat would work.

preference_highlighted