Open-source News

How I teach Python with open source tools

opensource.com - Fri, 04/21/2023 - 15:00
How I teach Python with open source tools Don Watkins Fri, 04/21/2023 - 03:00

I love to teach Python. I start by beginning where the learner begins. My first question is, "How would you like to learn Python?"

They usually answer, "What's Python?"

That's when I give them some examples of websites built with Python they might already be familiar with. I also provide examples of using Python in data science, engineering, web development, and, most recently, artificial intelligence and machine learning.

Most folks are intimidated when you try to introduce computer programming because their first efforts failed or someone told them programming is difficult. I show them a simple print statement that easily demonstrates how much the Python syntax is like the language they speak.

>>> print("Hello World") Hello World

Unless they are Linux or macOS users, they might need help installing Python on their computer. I guide them through downloading Python from the Python.org website and installing it on their computer. Next, I help them set up a development environment. For many users this is IDLE.

More Python resources What is an IDE? Cheat sheet: Python 3.7 for beginners Top Python GUI frameworks Download: 7 essential PyPI libraries Red Hat Developers Register for your free Red Hat account Latest Python articles A good Python IDE

For a young student, I introduce Mu, a great development environment for elementary and middle school students. Adults and older students might use VSCodium.

Python REPL

I often introduce new users to the REPL so they can execute their code easily. Then I show them how to write a simple program with a print statement print("Hello World") and save it as a text file with a .py extension. I explain that the .py extension is necessary for Python to recognize the program.

Turtle

Then I introduce them to Python fundamentals, including variables, strings, numbers, and basic operations. I suggest Python libraries like the Turtle, which even adults find fascinating. I start simply in the REPL:

import turtle turtle.forward(100) turtle.right(90)

This example demonstrates how easy it is to write code in Python and how just a few lines can produce a graphic on their display. Then I show how to draw a square:

import turtle turtle.forward(100) turtle.right(90) turtle.forward(100) turtle.right(90) turtle.forward(100) turtle.right(90) turtle.forward(100) turtle.right(90)

Then I cover control structures like the if statement, elif, for, and while. I demonstrate drawing that same square quickly and easily with a for loop:

import turtle for x in range(4): turtle.forward(100) turtle.right(90)Teaching Python is a gift

When you teach, it's important to begin where the learner is and engage them in their own edification. This approach has them leaning in for more information, ensuring they gain skill and competency.

Your local public library might be a great place to find students who would like to learn Python. Most libraries would be very happy to have you volunteer to help their patrons.

Teaching Python to others is easy with these open source tools and techniques.

Image by:

Opensource.com

Python Education What to read next How I teach Python on the Raspberry Pi 400 at the public library How my students taught me to code This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Autojump – Quickly Navigate Directories and Linux File System

Tecmint - Fri, 04/21/2023 - 14:31
The post Autojump – Quickly Navigate Directories and Linux File System first appeared on Tecmint: Linux Howtos, Tutorials & Guides .

Those Linux users who mainly work with Linux command Line via console/terminal feels the real power of Linux. However, it may sometimes be painful to navigate inside the Linux Hierarchical file system, especially for

The post Autojump – Quickly Navigate Directories and Linux File System first appeared on Tecmint: Linux Howtos, Tutorials & Guides.

bd – Quickly Go Back to a Parent Directory Instead of Typing “cd ../../..” Redundantly

Tecmint - Fri, 04/21/2023 - 12:31
The post bd – Quickly Go Back to a Parent Directory Instead of Typing “cd ../../..” Redundantly first appeared on Tecmint: Linux Howtos, Tutorials & Guides .

While navigating the file system via the command line on Linux systems, in order to move back into a parent directory (in a long path), we would normally issue the cd command repeatedly (cd

The post bd – Quickly Go Back to a Parent Directory Instead of Typing “cd ../../..” Redundantly first appeared on Tecmint: Linux Howtos, Tutorials & Guides.

Gogo – Create Directory “Bookmarking” in Linux

Tecmint - Fri, 04/21/2023 - 11:00
The post Gogo – Create Directory “Bookmarking” in Linux first appeared on Tecmint: Linux Howtos, Tutorials & Guides .

Gogo is an impressive way to bookmark directories inside your Linux shell. It allows you to create shortcuts to long and complicated paths in Linux. This way, you don’t have to type or remember

The post Gogo – Create Directory “Bookmarking” in Linux first appeared on Tecmint: Linux Howtos, Tutorials & Guides.

Perfect order: Delivering the right products at the right time in the right quantity

Red Hat News - Fri, 04/21/2023 - 08:00
<p>Within <em>inventory management</em>, perfect order refers to the ability to deliver the correct product to the customer, in the right quantity, at the right time, in the right condition, with the right documentation and at the right cost. Essentially, it means meeting customer demand without errors or delays to the highest degree possible. Inventory management encompasses procedures and processes that directly or indirectly affect the bottom line ordering, receiving, storing, tracking and accounting for all of the goods a business sells. It is a ke

Rust 1.69 Released - No Longer Includes Debug Info In Build Scripts By Default

Phoronix - Fri, 04/21/2023 - 06:39
Rust 1.69 is out today as stable as the newest update to this increasingly popular programming language that has become passionate to many open-source developers for its memory safety guarantees and other principles...

Intel i219-LM Had Only Been Running At ~60% Of Maximum Speed Due To Linux Driver Bug

Phoronix - Fri, 04/21/2023 - 05:00
If you rely on an Intel I219-LM Gigabit Ethernet adapter, you will want to look forward to upgrading your Linux kernel build soon... A fix was committed today after Intel engineers discovered this particular Ethernet chipset had only been running at around 60% of its maximum speed due to a regression introduced back in 2020...

AMD Posts New Linux Patches Enabling Dynamic Boost Control

Phoronix - Fri, 04/21/2023 - 02:30
A new patch series from AMD today for the Linux kernel enables Dynamic Boost Control support that can be found with some Ryzen SoCs for tuning the processor for optimal performance...

Intel Posts Linux Patches Enabling LASS KVM Support

Phoronix - Fri, 04/21/2023 - 01:13
Back in January Intel engineers posted Linux patches for Linear Address Space Separation (LASS) as a feature being introduced with future Intel CPUs. Intel engineers today posted a set of patches extending that LASS support to the realm of KVM virtualization...

Pages