Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
360 views
in Technique[技术] by (71.8m points)

Python long list is broken into annoying multiple line in VScode?

enter image description here

Hi, I am using VScode for python. I face an annoying point in autoformat that a long list is broken into multiple lines as shown in the picture. I try to change wordwrap property but it does not help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I use the Python formatting toolkit "autopep8", and its effects are as follows:

enter image description here

"python.formatting.provider": "autopep8",

It is recommended that you check whether there are related settings in the file "settings.json" that affect the use of formatting.

The "autopep8" in VSCode is used as the formatting code of the Python formatting toolkit. We can use it by installing it using pip. Please disable related formatting extensions to avoid interference.

More references: Formatting in VSCode.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...