• Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions
Flyy Tech
  • Home
  • Apple
  • Applications
    • Computers
    • Laptop
    • Microsoft
  • Security
  • Smartphone
  • Gaming
  • Entertainment
    • Literature
    • Cooking
    • Fitness
    • lifestyle
    • Music
    • Nature
    • Podcasts
    • Travel
    • Vlogs
  • Camera
  • Audio
No Result
View All Result
  • Home
  • Apple
  • Applications
    • Computers
    • Laptop
    • Microsoft
  • Security
  • Smartphone
  • Gaming
  • Entertainment
    • Literature
    • Cooking
    • Fitness
    • lifestyle
    • Music
    • Nature
    • Podcasts
    • Travel
    • Vlogs
  • Camera
  • Audio
No Result
View All Result
Flyy Tech
No Result
View All Result

How To Install Python on Windows 10 and 11

flyytech by flyytech
September 28, 2022
Home Computers
Share on FacebookShare on Twitter


Originally created by Guido van Rossum in 1991, Python is a versatile programming language used by makers on the Raspberry Pi, system administrators in the data center, and even by Industrial Light and Magic to bring our movies to life.

Python is a great language to learn, and thanks to the Raspberry Pi for the past decade there have been countless tutorials covering the gamut of programming projects.

Whether you are a Python veteran, a “pythonista” or a complete newcomer to the language, installing Python on Windows is an easy task. In this how to we will walk you through installing Python 3 on Windows and show two editors, one for beginners and the other for intermediate and advanced users, and how you can get coding with this fantastic language.

Installing Python 3 on Windows 10 and 11

The installation process for Python 3 on Windows is simple, with only a couple of extra steps that we have to follow. These steps enable us to access Python from anywhere on our system and install software using its built-in package manager. Installing Python in this manner enables the creation of projects that work with the operating system, for example notifications and automated system tasks.

1. Open a browser to the Python website and download the Windows installer.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

2. Double click on the downloaded file and install Python for all users, and ensure that Python is added to your path. Click on Install now to begin. Adding Python to the path will enable us to use the Python interpreter from any part of the filesystem.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

3. After the installation is complete, click Disable path length limit and then Close. Disabling the path length limit means we can use more than 260 characters in a file path.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

4. Click Close to end the installation.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

Running Python in Windows

1. Open a Command Prompt and type “python” then press Enter.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

2. Create a short Python script that uses a for loop to print a message to the Python shell ten times. Press space four times to indent the second line, otherwise Python will produce an error. Press Enter to run the code.

for i in range(10):
    print(“Python in the command prompt”)

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

Python comes with its own package manager, pip, that is used to install, update and remove modules of pre-written Python code. These modules provide us with extra functionality. To demonstrate we will use pip to install the pyjokes module, a collection of programmer jokes.

1. Open a Command Prompt and use pip to install pyjokes then press Enter.

pip install pyjokes

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

2. Open the Python interpreter.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

3. Import the pyjokes module and then print a joke from the module. In our case, we got a “hip hip hurray” take on an array containing two hips.

import pyjokes
print(pyjokes.get_joke())

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

4. More modules can be found using the PyPi Package Index.

Beginning Python With Mu

If you have never written a line of Python code, then Mu is for you. Created by Nicholas Tollervey, Mu is designed with beginners in mind. The simple interface means we can focus on our code. But don’t underestimate Mu as under the hood we have tools to validate our code and to work with a diverse range of boards such as Raspberry Pi Pico, Adafruit CircuitPython and many MicroPython boards, including those from Lego.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

1. Open a browser to the Mu website and download the Windows installer.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

2. Go to the Downloads folder and double click the Mu file to begin installation.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

3. Accept the license agreement and click Install. The install process will take a few moments to complete.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

4. Click on Launch Mu Editor and then click Finish. This will close the installer and start Mu.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

5. Wait for Mu to start. Mu’s first launch can take some time to complete, subsequent boots will be much faster.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

The Mu Editor Interface

Mu was designed with beginners in mind and this is reflected in the user interface. It is uncluttered and easy to understand.

The user interface is broken down into three areas.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)
  1. The menu bar. Large icons and clear text identify the function of each button. We can create, save and load files. We can also run and stop our code. The Python Shell (REPL, Read, Eval, Print, Loop) is available to test ideas. A plotter can be used to visualize data via a graph. We can zoom in and out of the code, useful when presenting to large groups. A builtin checker and tidy application will check and format your code using Python style guidelines.
  2. The coding area. Here we write the code for our projects.
  3. The Python shell. It can output the results of our code and it can be used to access the REPL.

We can easily write Python code in Mu. The default is to write Python 3 code, to be run on our machine. This is where the ease of Mu works against it, as there is no means to install Python modules. Modules are libraries of code that can be used to add new features, for example RPi.GPIO and GPIO Zero are modules that enable Python to talk to the Raspberry Pi GPIO.

If you are starting out with Python, Mu is an excellent choice to introduce the language.

Mu Modes

Mu has one feature that elevates it above other beginner editors. Mu has a “Mode” button which can be used to write Python, MicroPython and CircuitPython.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

2. Select the Mode from the list. Mu comes with a plethora of modes. We can write Python 3, make games using PyGame Zero or build websites/apps using Flask. Write MicroPython for the Raspberry Pi Pico, micro:bit. ESP, Pyboard and Lego Spike. Or we can use Adafruit’s CircuitPython to create physical computing projects.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

Connecting a Raspberry Pi Pico, MicroPython or CircuitPython board will trigger Mu to ask if we would like to change the mode to match the board. To demonstrate this we’ll write a short project to blink the Pcio’s onboard LED.

To follow this part of the how to you will need a Raspberry Pi Pico.

1.  With Mu open, connect a Raspberry Pi Pico to your computer.

2. Using the pop-up, change the mode for the Raspberry Pi Pico (RP2040). 

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

3. The Mu editor is now in RP2040 mode, so click on REPL to open the MicroPython shell (REPL) on the Pico.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

4. In the editor import two modules, first to enable access to the GPIO, the second to add pauses to the code.

import machine
from time import sleep

5. Create an object, led and use it to set the onboard LED as an output. For the Raspberry Pi Pico W use the line of code with ‘LED’, for the original Pico use the line of code with 25. The Pico has the LED connected to GPIO 25, but the Pico W does not.

Raspberry Pi Pico W

led = machine.Pin('LED', machine.Pin.OUT)

Raspberry Pi Pico

led = machine.Pin(25, machine.Pin.OUT)

6. Create a for loop that iterates 10 times, each time the loop runs it will toggle the LED on / off, print a message to the REPL and sleep for 0.1 seconds.

for i in range(10):
    led.toggle()
    print("BLINK")
sleep(0.1)

7. Click Save and save the file as blink.py to your computer.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

8. Click Run to start the code on the Pico. The LED on the Pico will blink on and off and the REPL will show the “BLINK” message.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

You know your stuff, and you need a lightweight editor to get your Python code done. Sure you can install Visual Studio Code, PyCharm etc. But if you just need to edit a few project files, Notepad++ is for you. Notepad++ is a Swiss Army Knife of an editor, and it works exceptionally well with Python. Here we will install Notepad++ and set it up to run our Python code at the press of a button.

Note that you will need to install the Python 3 interpreter, the steps for which are at the start of this how to.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

1. Open a browser to the Notepad++ website and download the latest Windows installer.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

2. In the your Downloads folder, double click on the file to start the installer.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

3. Set your preferred language and click OK.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

4. Select Next.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

5. Select “I Agree”.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

6. Click Next.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

7. Click Next.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

8. Click Install to begin the process.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

9. Check “Run Notepad++” and click Finish to end the installation and open Notepad++.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

The Notepad++ Interface

Notepad++ has a more involved user interface than Mu, and this reflects the flexibility of the editor. Notepad++ is much more than a Python editor, we can use it to write PHP, Perl, JSON etc.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)
  1. Menus. Here we can load projects, save, create macros and install plugins for specific languages.
  2. Editor. The code for our project is created here.
  3. Workspace. If we are working on a large project with multiple project files, we can load the folder as a workspace and have quick access to the files.

Running Python code in Notepad++

1. Create a simple Python project that uses a for loop to print a message to the Python shell.

for i in range(10):
    print("Writing Python in Notepad++")

2. Save the code as for_loop.py.

3. Click on Run >> Run..

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

4. Click on … and navigate to the Python executable file. Select the file and the path will be added to the dialog box. At the end of the path, add -i “$(FULL_CURRENT_PATH)” to force Notepad++ to open the file. Click Save.

Example path to Python
C:\Users\LattePanda\AppData\Local\Programs\Python\Python310\python.exe -i "$(FULL_CURRENT_PATH)"

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

5. Create a shortcut called Python3.10 to launch the Python interpreter then click OK. We chose ALT + SHIFT + P as it didn’t conflict with other shortcuts on our system.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)

6. Use your shortcut to run the Python code.

How To Install Python on Windows 10 and 11

(Image credit: Tom’s Hardware)



Source_link

flyytech

flyytech

Next Post
How To Remove/Erase Deep Scratches From Aluminum Laptop 2022

How To Remove/Erase Deep Scratches From Aluminum Laptop 2022

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended.

Dangerous hole in Apache Commons Text – like Log4Shell all over again – Naked Security

Dangerous hole in Apache Commons Text – like Log4Shell all over again – Naked Security

October 18, 2022
The Secret Vulnerability Finance Execs are Missing

The Secret Vulnerability Finance Execs are Missing

February 23, 2023

Trending.

Image Creator now live in select countries for Microsoft Bing and coming soon in Microsoft Edge

Image Creator now live in select countries for Microsoft Bing and coming soon in Microsoft Edge

October 23, 2022
Shop now. Pay later. on the App Store

Shop now. Pay later. on the App Store

February 25, 2023
How To Install Tiny11 for Arm64 on Raspberry Pi 4

How To Install Tiny11 for Arm64 on Raspberry Pi 4

February 19, 2023
Thermalright Peerless Assassin 120 SE Review: Incredible, Affordable Air Cooling Performance

Thermalright Peerless Assassin 120 SE Review: Incredible, Affordable Air Cooling Performance

September 27, 2022
Hackers behind MGM cyberattack thrash the casino’s incident response

Hackers behind MGM cyberattack thrash the casino’s incident response

September 16, 2023

Flyy Tech

Welcome to Flyy Tech The goal of Flyy Tech is to give you the absolute best news sources for any topic! Our topics are carefully curated and constantly updated as we know the web moves fast so we try to as well.

Follow Us

Categories

  • Apple
  • Applications
  • Audio
  • Camera
  • Computers
  • Cooking
  • Entertainment
  • Fitness
  • Gaming
  • Laptop
  • lifestyle
  • Literature
  • Microsoft
  • Music
  • Podcasts
  • Review
  • Security
  • Smartphone
  • Travel
  • Uncategorized
  • Vlogs

Site Links

  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions

Recent News

GitHub’s Innovation Graph offers ongoing data about software development

GitHub’s Innovation Graph offers ongoing data about software development

September 25, 2023
National Cybersecurity Alliance Receives 200K Grant From Craig Newmark Philanthropies for HBCU Cybersecurity Program

A Recipe for Accurate Bot Protection

September 25, 2023

Copyright © 2022 Flyytech.com | All Rights Reserved.

No Result
View All Result
  • Home
  • Apple
  • Applications
    • Computers
    • Laptop
    • Microsoft
  • Security
  • Smartphone
  • Gaming
  • Entertainment
    • Literature
    • Cooking
    • Fitness
    • lifestyle
    • Music
    • Nature
    • Podcasts
    • Travel
    • Vlogs

Copyright © 2022 Flyytech.com | All Rights Reserved.

What Are Cookies
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT