I’m following the recent Python Tutorial for Beginners (with mini-projects). So my settings are set up just as Dave’s at 29:25, I did everything just like him (except I’m on Mac and not Windows), and when I save or try to manually format the document it isn’t formatting anything, nothing changes. Can someone please help?
Did you install the “Python VS Code extension” from Microsoft? And if you select ‘Format Document With…’ does it give you the option for ‘Python’ under “Select Formatter?”
In this video he also shows how to display the settings json file. Can you copy the contents of that here (Or just check under the Python section?)
addendum: maybe even just skip this part, not a huge fan of installing an auto-formatter first thing in a beginner’s course about Python where formatting is so important, in fact a major feature of the language
Yes nothing changes.
I did the same thing as Dave in the video and put an indentation where there shouldn’t be one, and when I save or format with python, nothing changes like it does for him
Hi, Ive just had the same issue. Im not sure how its successfully removing the spaces before line04 in Daves example, when I try it does nothing. It also prompts to use either Black or autopep8 as the formatter. I ended up installing Black and setting that as the default. Opening the Output window for Black I could see it complaining “Skipping non python code”. Basically the formatter is working but it’s not seeing the spaces before line04 in Daves example as python code so its doing nothing. If you were to put a bunch of spaces between ‘line04 =’ and “*****” it will reformat ok.
Hi, this is Dave from the video. The latest versions of VS Code no longer support the auto-formatting I demonstrated. That said, I did the research, and if you want this formatting behavior, I show you how to get it back here: How to Auto-Format Unwanted Python Line Indentations in VS Code | Dave Gray
Hey please im having the same problem been stuck on it for a month, have reinstalled vscode multiple times and followed multiple tutorials to try and activate it , eventually installed black formatter and autopep8 but nothing is working tried so many stuff , please do you know any work arounds