In this tutorial, we’ll be discussing Python Intellisense and its Autocomplete installation. Python Intellisense provides users with intelligent code completions based on their source code analysis and language semantics.
Python Intellisense is a good starter for familiarizing the native functions available depending on a specific element or method we’ll use.
Let’s start by adding a couple more cells to our Jupyter Notebook. You can do this by typing esc+B. Now that I have added more cells, I’ll type in our variable data. As we type in any letters, the list of members shown is filtered to only include members containing our typed characters.
By typing in a dot (.), you’ll see a list of available functions that we can use as we type in a specific character. Intellisense can be triggered by typing Ctrl+Space or a trigger character such as the dot (.) in any editor window.
Setting Up Python Intellisense In Jupyter Notebook
To set up Python IntelliSense in Jupyter Notebook, navigate to your command prompt. If you have already installed Python with Anaconda, just use your Anaconda prompt. We use this to install the packages that we want.
With my Anaconda prompt, I’ll install a package called ‘contrib_nbextensions’. This package contains an extension called Hinterland that enables a code autocompletion menu for every keypress in a code cell instead of only enabling it with a tab in your Jupyter Notebook. This extension can help us better understand Python functions and make our coding more efficient.
Installing Intellisense and Autocomplete For Jupyter Notebook
In our Anaconda prompt, we’ll use the command ‘pip install’ to install the package we’re looking for. Then type in ‘jupyter_contrib_nbextensions’ and click enter.
After doing that, we’ll be able to see all of the different contrib nbextensions that are installed in our Jupyter Notebook.
Next, we’re going to navigate back over to our Jupyter Notebook homepage. Then click on the ‘Nbextensions’ tab. If ever you encounter an issue loading your homepage, you can just reopen your Jupyter Notebook and it should be able to load.
Initially, we’ll see a prohibition sign and an exclamation circle sign on the left side of every configurable nbextensions that we have in our Jupyter Notebook.
The prohibition sign indicates unclicked or uninstalled contrib nbextension, while the exclamation circle sign indicates clicked or installed contrib nbextensions.
On the upper left corner, you’ll notice a box with a checkmark. That prevents us from clicking or installing any of our configurable nbextensions. Just uncheck the box so we can navigate and install the configurable nbextensions we want or need. Since we need to install Intellisense, let’s click on the extension Hinterland.
Let’s now go back to our Python Notebook. As we type in characters in our code cell, more suggestions of functions are made available. This includes the list of simple to complex members that we’re able to be familiar with and study.
In brief, Python Intellisense helps us reduce or prevent syntactical or typographical errors. It enables us to evaluate codes as we type and use a few keystrokes to implement certain code aspects. It also allows us to be more efficient in code writing and tracking our activities to reduce errors and improve accuracy.
I hope you’re able to understand how Python Intellisense works and how it’s essential for users regarding code making. If you’d like to know more about this topic and other related content, you can certainly check out the list of relevant links below.
All the best,
***** Related Support Forum Posts *****
Power BI Python Script Error
Simulating An Epidemic using Python in Power BI
Error Faced When Importing Data In PBI Using Python Script
For more Python queries to review, see here…