4

I've been using VS Code from a week and I want to use VS Code built-in Python snippets but it is not working for me. I've tried JS snippets and it is working fine in VS Code but Python snippets are not working.

Image links:

JS Snippet: enter image description here PY snippet: enter image description here

Mohamed Bdr
  • 967
  • 3
  • 9
  • 20

2 Answers2

15

Found the answer:

It seems they decided to remove code snippets from the python extension in the last update: changelog in vscode

They may be added back in the future but for now i would suggest just using the python snippets extention: https://marketplace.visualstudio.com/items?itemName=frhtylcn.pythonsnippets

Jamshed
  • 159
  • 1
  • 7
  • 5
    If you want the exact old snippets because you're used to them (like I was) they can be found [here](https://github.com/microsoft/vscode-python/blob/2020.12.424452561/snippets/python.json) and added to your user snippets. – Zeph Jun 09 '21 at 22:19
-1
  1. Install the Python extension for VS Code from the Visual Studio Marketplace(Link)

  2. To verify that you've installed Python successfully on your machine, run one of the following commands (depending on your operating system):

Linux/macOS: open a Terminal Window and type the following command:

python3 --version

Windows: open a command prompt and run the following command:

py -3 --version
  1. From within VS Code, select a Python 3 interpreter by opening the Command Palette (Ctrl+Shift+P), start typing the Python: Select Interpreter command to search, then select the command. You can also use the Select Python Environment option on the Status Bar if available (it may already show a selected interpreter, too)

Refer to this article for more information

Tahil Bansal
  • 135
  • 6