Skip to content

Latest commit

 

History

History
81 lines (52 loc) · 5.78 KB

LEARN.md

File metadata and controls

81 lines (52 loc) · 5.78 KB

Installation Of Python

Installation Python On Windows

  • Go to the official Python website at https://www.python.org/downloads/windows/.
  • Click on the "Download Python" button for the latest version of Python for Windows.
  • Select the appropriate download link for your Windows version and whether it's 32-bit or 64-bit.
  • Run the installer executable file once it has downloaded.
  • Follow the instructions provided by the installer to complete the installation.
  • Once installed, open a command prompt window and type "python" to verify that Python has been installed correctly.

Installation of Python on macOS

  • Go to the official Python website at https://www.python.org/downloads/mac-osx/.
  • Click on the "Download Python" button for the latest version of Python for macOS.
  • Select the appropriate download link for your version of macOS.
  • Run the installer package once it has downloaded.
  • Follow the instructions provided by the installer to complete the installation.
  • Once installed, open a Terminal window and type "python" to verify that Python has been installed correctly.

Installation of Python on Linux

The specific steps for installing Python on Linux will vary depending on the distribution you are using. Here's a general guide:

  • Open a terminal window.
  • Use your package manager to search for the Python package by typing "sudo apt-get install python" (for Ubuntu/Debian-based distributions) or "sudo yum install python" (for CentOS/Fedora-based distributions).
  • Follow the instructions provided by the package manager to complete the installation.
  • Once installed, type "python" in the terminal to verify that Python has been installed correctly.

Alternatively, you can download the source code from the official Python website and compile it yourself. However, this process is more complicated and requires more technical knowledge.

That's it! You should now have Python installed on your operating system.

Install Visual Studio Code

With Python installed on your system, you can turn your attention to a tool for writing Python code. As mentioned in the introduction to this documentation, although you can use a plain text editor to create or edit Python applications, a code editor, such as Visual Studio Code, provides a greater level of support.

Let's explore the toolkit available through Visual Studio Code, and how to install it.

Tools To Write Python Code

You typically write Python Syntax in a text fle and save it to your local hard drive. You can write code by using a simple text file editor, such as Notepad in Windows. Notepad edits ASCII text, a standard text file format.

You want to avoid any text editor that has formatting options, like bold, underline, or italics, or any other program with word-processing features. So you shouldn't write code in Microsoft Word or TextEdit on macOS. These programs incorporate formatting instructions that the Python compiler can't understand.

You'll want to use a tool that's best suited for the unique challenges of writing code. There are plenty of options to choose from, but many developers rely on Visual Studio Code, or VS Code. It's free and available on Windows, macOS, and Linux. It has many features that make it easy to navigate and compile code for all programming languages.

Microsoft provides a Python extension for Visual Studio Code. This extension offers features like syntax highlighting, code navigation, code formatting support, and more. One feature in particular, named IntelliSense, is invaluable when you're getting started. Intellisense provides autocomplete and contextual help as you type.

In your browser, navigate to Visual Studio Code download page;

  • The web page displays logos for Windows, Linux, and Mac.
  • Select and download the Visual Studio Code installer for Windows. Most browsers give you the option to either save the file to your local computer (usually in your Downloads folder) or immediately run the installer file.

Note

  • After downloading the installer, you may need to open File Explorer and navigate to the location your web browser
    installed it. The most common location is the Downloads folder.
  • Double-click the installer file to start the installation process and run through the setup.
  • After the installation is complete, Visual Studio Code launches automatically.

Install the Python extension for Visual Studio Code

When Visual Studio Code is installed, you can install the Python extension, and, optionally, set up other tools and settings. Visual Studio Code is a powerful code editor and a lightweight general-purpose integrated development environment (IDE) with a wide range of extensions available to provide functionality in various programming languages. The Python extension for Visual Studio Code provides visual cues, such as color coding and autocomplete, and debugging tools to help you write better Python code, and to write code faster. This exercise installs the Python extension to your existing VS Code application.

  • In Visual Studio Code, select View > Extensions to open the Extensions view.

  • The Visual Studio Code Extensions view lists the installed extensions and recommended extensions from the most popular on Marketplace.

  • Filter the list of available extensions by entering python in the search box at the top of the Extensions view.

  • Select the Python extension published by Microsoft (described as IntelliSense (Pylance) and usually the first one in the list). The details about that extension appear in a tabbed panel on the right.

  • In either the Extensions panel, or in the main panel, select Install.

  • When the installation is complete, the Install button changes to a Settings ⚙️ icon in the Extensions view or two buttons, Disable and Uninstall in the main panel. This message lets you know that you've successfully installed the Python extension for Windows.