ChatGPT解决这个技术问题 Extra ChatGPT

Word wrapping in PyCharm Python Console?

Anybody here who knows, if and how I could enable word wrap in the Python console for long lines? I can't see them as a whole, I have always to scroll the window to the righit, to get all informations. I have only 5 Buttons offered: rerun, stop, close, execute current statement, help.

(in contrast to this, in Event Log, I see buttons called "Use soft wraps".)


B
Bing Ren

for version 3.4.1:

View -> Active Editor -> Use Soft Wraps


This answer is actually about the editor, not the console. Also, this only works on a file-by-file basis (you'd have to set it separately for each file). To set it globally for ALL files you edit, the checkbox is right above the one in @Hartmut's answer below: File -> Settings -> Editor -> "Virtual Space" group -> Use soft wraps in editor.
works for Mac Pycharm edition 4.5 View- Active Editor -> Use Soft Wraps
This does work for the console, as well as the editor. It affects the currently active editor/tool window, so ensure the console is active (click in it) first.
z
zwep

I found the answer here:

File -> Settings -> Editor -> "Virtual Space" group -> Use soft wraps in console

In Pycharm version 2018.3.3 it can be found under

File -> Settings -> Editor -> General -> Console: Use soft wraps in console

PyCharm 2018: File→Settings→Editor→General→Console: Use soft wraps in console
after this did not work on 2020.2.3 community, i had to try stackoverflow.com/a/38149710/5228718
There's another setting tucked in this page for when working with markdown and other file types in PyCharm (I'm using its great markdown editor!!) programmersought.com/article/29724237816
W
Wok

Starting with Pycharm Community Edition 2016.1, the settings mentioned in other answers are gone.

However, with the debug console opened (i.e. run your python script), click the Use Soft Wraps button there, this will also affect the python console, without any restart needed.

https://i.stack.imgur.com/6QxfT.png


Same for the Pro version 2016.2 - great spot thanks! Poor show Jetbrains!
Thanks, this was bugging me!
This works with PyCharm Professional Edition 2018.1.3.
In my new project in 2019.2, the icons have disappeared??
@n1000 The icon on the very top of the python console is for using soft wraps, as of now in my 2019.2.4 version. If you have there no Icons at all you should check the installation maybe, if you have updates, that is, it could be the cause of the IDE not working as expected.
R
R J

For PyCharm version 4.5, soft wrap can be enabled as a global default here:

File > Settings > Editor > General > Soft Wraps > "Use soft wraps in editor"


W
Wok

Community edition its Preferences>Editor>General>Use Soft Wraps in Editor and then to be super cool you can go Preferences>Editor>General>Console>Use Soft Wraps in Editor

https://i.stack.imgur.com/KCIiF.png


I have pro, and none of the other posts worked in 2018-1 version.
C
Charles Brodhead III

For Pycharm Professional 2016.3.2 on Windows:

Click on the upper half of the Python Console (i.e. the output half, not the input line at the bottom).

On the main menu select Help and Find Action... (shortcut: CTRL + SHIFT + A).

Type "soft" in the "Enter action or option name" search box.

Toggle "Active Editor: Use Soft Wraps" to On.

Run a new command with long output and you should see it soft wrapped in the Python Console. Note, that previous output will not be wrapped.

(None of the above methods worked for the Python Console -- though they did work for the Debug Console and Event Log)


k
kayess

As of 2018 - I found the setting here:

Settings -> Editor -> General -> Console -> Use soft wraps in console:

https://i.stack.imgur.com/ocotg.png