💡 Chapter 2 UPDATE: 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: www.davegray.codes/posts/how-to-auto-format-unwanted-python-line-indents
autopep8 settings in VS Code have moved since this video. You need to search for and install the 'autopep8' extension (or another formatter). Then from the editor window (where you are compiling your code) right click and select "format document with..." this will open a selection where you can either select a formatter, e.g. autopep8 or assign/re-assign which formatter is used by default. Enjoy!
Not only Dave is a good teacher but he also adds the keyboard shortcut to his speech. This is golden .Thank you Sir for sharing your knowledge with the rest of the world. Be Blessed. Salutations from France.
Hey Dave! Ken here im just facing a small isuue with the vs code regaring the autopep8 which comes under the python extension somehow it says in the extension that it is installed but in the settings tab its not can u look into this?
Hi, unable to find the autopep8 settings within version 2023.14.0 even after a search so has this been updated or changed to something else anyone please? 🙂
Hi Dave, thank you very much for sharing the knowledge. I couldn't find "Python>formatting" and provider. When I save the file, it does not automatically get corrected. Please help
I had the same issue too Will keep you posted if I find a solution Edit: Apparently, this feature got removed on newer visual studio versions PS: I actually searched the whole internet but apparently a fellow commenter had found that it had been removed
Basic programming tutorials are the best, This welcome message brought back a lot of memories when BASIC language was a thing 😥 I think soon we'll be able to convert this example to a function that prints whatever message we feed it to. It really helped me calm my mind after some terrifying earthquakes. Thanks Dave,
'Python > Formatting:' ...is not to be found on my VS Python v1.81.1 ...what to do? A week later I found 'Python > Formatting:' under the WORKSPACE (not USER) tab, and then auto-indent started working. 🙂
formatter is not automatically set up and python was not in my path when I set it up. it was a nightmare to make it work and now i don't want to use vs code.
11:59 for the life of me I can't find this setting. I've followed all your instructions and even uninstalled and reinstalled VS Code and the Python extension, but the only setting I see when I type "python > formatting:" is "Configure settings to be overridden for the python language." (MacOS)
@@ronin_9 only if you see that folder in your file tree. You would click on it and then press the delete key. It would hold workspace settings that would override your user settings.
hi thanks for your great teaching. I was trying to open the python road map link in your caption but the link didn't open for me. can I have the road map, please ?!
Hi Dave i am pressing ctrl and s but it is not formatting my code like yours actually it dose nothing. i went through all the setting with you but it still dose nt work?
Sounds like you are using the Windows cmd terminal window. I was using a git bash terminal. Install git and you will have git bash if you want it to be just like mine.
Just out of curiosity, which IDE do you think is better for Python programming? I am currently using Pycharm, but that thing is way too heavy and takes up a lot of space in my SSD. I am thinking of using other IDEs, such as Visual Studio Code here. I just do not know how to evaluate these two things
Update Autopep8 is not working properly when i go into python > formatting: I only get my Json suggestion: Jason > format: Keep lines. Any ideas, anyone?
There is a pinned comment for the new formatting directions in the documentation. You could also use black instead of autopep8. There are enough questions on this that I might make a RU-vid short on it soon as well.
Hello Dave. Is this going to be a full course eventually? I’m just starting JavaScript and after that I have intention to learn Python. Moreover I like your explanations. Thanks.
something is not right! when i click the format on save it dose not stay on ?? as soon as i move to out of settings the box gose unclicked? this is what come up at the bottom right of the terminal "Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again."?
It would be great if I could create them all that fast. I still have a full-time job and other responsibilities. I will continue to create the videos at the weekly pace which is currently something I can sustain. Glad you like them!
Just getting started on Python. I have vsCode already installed (used it for your HTML/CSS course). Trying to get the formatter set up. I don't see anything in Settings for "python > formatting:"; in fact when I type ">" after python, almost everything disappears in the Settings window. I have the Python extension installed. I also don't see anything for formatting when I right-click in the editor window with a Python file open. Any ideas? PS. I do have the Prettier formatter installed which I used for HTML/CSS.
@@DaveGrayTeachesCodeThanks. I did see that post. The first part about clicking on the editor and selecting Format Document With...didn't work because there was no such item on the list. I finally just installed the autopep8 extension but had to disable Prettier before it would work, since it just kept reverting back to that as the default formatter. I didn't want to edit the .json file directly in case I did something wrong. Anyway, all good now but may install Black at some point.
Might help to know specifically what won't work from this video. My guess is the formatting part which VS Code changed with an update. Follow the new directions for VS Code here: code.visualstudio.com/docs/python/formatting
I think that work, but if u have syntax error, like few tabs, nothing work (black ore autopep8), its really hard after prettier (( First need fixed error, on video Dave formatted with error.
as a blind person this video isn't too useful right now as I only use shortcut keys to get around, I tried my best to follow along but got stuck at the start of the video, typing py in the terminal doesn't do what the guy said, just an error
Final lessons for you as you collect a 100% full refund for this free tutorial: You will go further in life by being kind. You cannot elevate yourself by tearing down others.
odd, my settings show indeed everything is set up '"window.zoomLevel": 2, "editor.accessibilitySupport": "off", "editor.fontSize": 14, "editor.formatOnSave": true, "[python]": { "editor.defaultFormatter": "ms-python.autopep8" }, "python.autoComplete.extraPaths": [' but upon saving nothing happens.
Have you installed the Python extension I covered in lesson 1? If so and you are still having issues, here is the VS Code docs help for formatting in Python: code.visualstudio.com/docs/python/editing#_formatting