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.
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.
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.
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.
4. Click Close to end the installation.
1. Open a Command Prompt and type python then press Enter.
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.
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.
2. Open the Python interpreter.
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.
4. More modules can be found using the PyPi Package Index.
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 dont 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.
1. Open a browser to the Mu website and download the Windows installer.
2. Go to the Downloads folder and double click the Mu file to begin installation.
3. Accept the license agreement and click Install. The install process will take a few moments to complete.
4. Click on Launch Mu Editor and then click Finish. This will close the installer and start Mu.
5. Wait for Mu to start. Mus first launch can take some time to complete, subsequent boots will be much faster.
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.
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 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.
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 Adafruits CircuitPython to create physical computing projects.
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 well write a short project to blink the Pcios 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).
3. The Mu editor is now in RP2040 mode, so click on REPL to open the MicroPython shell (REPL) on the Pico.
4. In the editor import two modules, first to enable access to the GPIO, the second to add pauses to the code.
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
Raspberry Pi Pico
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.
7. Click Save and save the file as blink.py to your computer.
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.
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.
1. Open a browser to the Notepad++ website and download the latest Windows installer.
2. In the your Downloads folder, double click on the file to start the installer.
3. Set your preferred language and click OK.
4. Select Next.
5. Select I Agree.
6. Click Next.
7. Click Next.
8. Click Install to begin the process.
9. Check Run Notepad++ and click Finish to end the installation and open Notepad++.
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.
1. Create a simple Python project that uses a for loop to print a message to the Python shell.
2. Save the code as for_loop.py.
3. Click on Run >> Run..
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.
5. Create a shortcut called Python3.10 to launch the Python interpreter then click OK. We chose ALT + SHIFT + P as it didnt conflict with other shortcuts on our system.
6. Use your shortcut to run the Python code.
See the rest here:
How To Install Python on Windows 10 and 11 - Tom's Hardware
- Research, Evaluation and Learning at the International Rescue Committee - World - ReliefWeb [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Conserving Biodiversity with AI - BBN Times [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- DevOps Fundamentals You Ever Wanted To Know - hackernoon.com [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Another Perspective on Evictions - Bacon's Rebellion [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Amitabh Bachchan on fans alternate job suggestion: My job is now insured - The Indian Express [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Will You Soon Download Packaging Machine Controls from the Internet? - Packaging Digest [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- 5 free resources every data scientist should start using today - The Next Web [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Who's hoping to make an Epic impact on Green Bay area music scene with a new concert venue? | Streetwise - Green Bay Press Gazette [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Industrial robots are dominating but are they safe from cyber-attacks? - TechHQ [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Friday Rant - Rise of the Rogue-Bots? - Diginomica [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Important Reasons Why You Should Pick RoR As Your Web-Based Development Project - Customer Think [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Portrait of the software developer as an artist - ComputerWeekly.com [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Python may be your safest bet for a career in coding - Gadgets Now [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- 1Password is coming to Linux - ZDNet [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- IBM creates an open source tool to simplify API documentation - TechRepublic [Last Updated On: August 10th, 2020] [Originally Added On: August 10th, 2020]
- Mastercard : Accelerate Ignites Next Generation of Fintech Disruptors and Partners to Build the Future of Commerce - Marketscreener.com [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- Expanding the Universe of Haptics | by Lofelt | Aug, 2020 - Medium [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- UX Designer Salary: 5 Important Things to Know - Dice Insights [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- Persistent memory reshaping advanced analytics to improve customer experiences - IT World Canada [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- NextCorps and SecondMuse Open Application Period for Programs that Help Climate Technology Startups Accelerate Hardware Manufacturing - GlobeNewswire [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- Buried deep in the ice is the GitHub code vault humanity's safeguard against devastation - ABC News [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- Top 12 Most Used Tools By Developers In 2020 - Analytics India Magazine [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- Facebook's React 17 JavaScript library: Here's why its top feature is 'no new features' - ZDNet [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- CORRECTING and REPLACING Anyscale Hosts Inaugural Ray Summit on Scalable Python and Scalable Machine Learning - Business Wire [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- Google: Here's how much we give to open source through our GitHub activity - ZDNet [Last Updated On: August 12th, 2020] [Originally Added On: August 12th, 2020]
- How Chriselle Lim And Joan Nguyen Created Bmo, The Coworking Space And Virtual Classroom Of The Future (With A Childcare Twist) - Forbes [Last Updated On: August 13th, 2020] [Originally Added On: August 13th, 2020]
- How Will Public Libraries Adapt To New School Year Norms? - Book Riot [Last Updated On: August 13th, 2020] [Originally Added On: August 13th, 2020]
- Google: We'll test hiding the full URL in Chrome 86 to combat phishing - ZDNet [Last Updated On: August 13th, 2020] [Originally Added On: August 13th, 2020]
- How to install Python 3 and PIP 3 on Ubuntu 20.04 LTS - Linux Shout - H2S Media [Last Updated On: August 13th, 2020] [Originally Added On: August 13th, 2020]
- What are Bitcoin Wallets: Everything You Need to Know - Programming Insider [Last Updated On: August 13th, 2020] [Originally Added On: August 13th, 2020]
- JSHint is Now Free Software after Updating License to MIT Expat - WP Tavern [Last Updated On: August 13th, 2020] [Originally Added On: August 13th, 2020]
- How to learn JavaScript: These are the best online courses - Mashable [Last Updated On: August 13th, 2020] [Originally Added On: August 13th, 2020]
- What developers need to know about inter-blockchain communication - ComputerWeekly.com [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- Introducing the CDK construct library for the serverless LAMP stack - idk.dev [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- IBM asked software developers to take on the wrath of Mother Nature - The Drum [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- Aspire Technology Launches First Truly Secure Public Blockchain for Creation of Digital Assets - GlobeNewswire [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- GM Creates And Shares New Workplace Safety Technologies - Pulse 2.0 [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- Key Considerations and Tools for IP Protection of Computer Programs in Europe and Beyond - Lexology [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- The state of application security: What the statistics tell us - CSO Online [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- Open Source: What's the delay on the former high/middle school on North Mulberry? - knoxpages.com [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- The Risks Associated with OSS and How to Mitigate Them - Security Boulevard [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- news digest: Microsoft launches open source website, TensorFlow Recorder released, and Stackery brings serverless to the Jamstack - SD Times -... [Last Updated On: August 14th, 2020] [Originally Added On: August 14th, 2020]
- Build Your Own PaaS with Crossplane: Kubernetes, OAM, and Core Workflows - InfoQ.com [Last Updated On: August 17th, 2020] [Originally Added On: August 17th, 2020]
- ISRO Is Recruiting For Vacancies with Salary Upto Rs 54000: How to Apply - The Better India [Last Updated On: August 17th, 2020] [Originally Added On: August 17th, 2020]
- Does technology increase the problem of racism and discrimination? - TechTarget [Last Updated On: August 17th, 2020] [Originally Added On: August 17th, 2020]
- CORRECTING and REPLACING Anyscale Hosts Inaugural Ray Summit on Scalable Python and Scalable Machine Learning - Yahoo Finance [Last Updated On: August 17th, 2020] [Originally Added On: August 17th, 2020]
- In the City: Take advantage of open recreation, cultural and park amenities - Coloradoan [Last Updated On: August 17th, 2020] [Originally Added On: August 17th, 2020]
- Exploring the future of modern software development - ComputerWeekly.com [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Hadoop Developer Interview Questions: What to Know to Land the Job - Dice Insights [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- SiFive Opens Business Unit to Build Chips With Arm and RISC-V Inside - Electronic Design [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Use Pulumi and Azure DevOps to deploy infrastructure as code - TechTarget [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Why ASP.NET Core Is Regarded As One Of The Best Frameworks For Building Highly Scalable And Modern Web Applications - WhaTech [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- NITK figures 4th in Google Summer of Code ranking - BusinessLine [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Learn More About Dynamo for Revit: Features, Functions, and News - ArchDaily [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Linux Foundation showcases the greater good of open source - ComputerWeekly.com [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Programming language Kotlin 1.4 is out: This is how it's improved quality and performance - ZDNet [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Top 10 Languages That Paid Highest Salaries Worldwide In 2020 - Analytics India Magazine [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Programming language Rust: Mozilla job cuts have hit us badly but here's how we'll survive - ZDNet [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- In-App Bidding Gathers Steam, But Adoption Looks Nothing Like Header Bidding On The Web - AdExchanger [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- 13 thoughts on Fitting Snake Into A QR Code - Hackaday [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Newham test and trace app was designed by man who grew up in the borough - Newham Recorder [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- 'Trapped in a code' the fight over our algorithmic future - Open Democracy [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Telegram launches one-on-one video calls on iOS and Android - The Verge [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- AWS Controllers for Kubernetes Will Be A 'Boon For Developers' - CRN: Technology news for channel partners and solution providers [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Coding within company constraints - ComputerWeekly.com [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Open Source and Open Standards: The Recipe for Success Featured - The Fast Mode [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- How Intel helped give the worlds first cyborg a voice - The Next Web [Last Updated On: August 21st, 2020] [Originally Added On: August 21st, 2020]
- Tiger Woods, Rory McIlroy near bottom of field at The Northern Trust - ESPN [Last Updated On: August 22nd, 2020] [Originally Added On: August 22nd, 2020]
- Intel Owl OSINT tool automates the intel-gathering process using a single API - The Daily Swig [Last Updated On: August 22nd, 2020] [Originally Added On: August 22nd, 2020]
- IOTA Foundation presents the current projects in the mobility industry - Crypto News Flash [Last Updated On: August 22nd, 2020] [Originally Added On: August 22nd, 2020]
- How 'Fortnite' and 'Second Life' Shaped the Future of Indian Market - Santa Fe Reporter [Last Updated On: August 22nd, 2020] [Originally Added On: August 22nd, 2020]
- Apple Enters $ 2 Trillion Club, Github's Chinese Counterpart And More In This Week's Top News - Analytics India Magazine [Last Updated On: August 22nd, 2020] [Originally Added On: August 22nd, 2020]
- As world grapples with pandemic, schools are the epicenter - ABC News [Last Updated On: August 24th, 2020] [Originally Added On: August 24th, 2020]
- Why Businesses Should Embrace Modernizing Their Legacy Applications - TechBullion [Last Updated On: August 24th, 2020] [Originally Added On: August 24th, 2020]
- Is It Time To Rename RPG? - IT Jungle [Last Updated On: August 24th, 2020] [Originally Added On: August 24th, 2020]
- Phantasy Star Online programmers on breaking new ground and their Diablo-style isometric prototype - Polygon [Last Updated On: August 24th, 2020] [Originally Added On: August 24th, 2020]
- How To Learn To Program In Python By Playing Videogames - Analytics India Magazine [Last Updated On: August 24th, 2020] [Originally Added On: August 24th, 2020]
- New Microsoft program to help develop the quantum computing workforce of the future in India - Microsoft [Last Updated On: August 24th, 2020] [Originally Added On: August 24th, 2020]
- How the Docker Revolution Will Change Your Programming, Part 1 - Walter Bradley Center for Natural and Artificial Intelligence [Last Updated On: August 24th, 2020] [Originally Added On: August 24th, 2020]
- The art of developing happy customers - ComputerWeekly.com [Last Updated On: August 24th, 2020] [Originally Added On: August 24th, 2020]