{"id":72838,"date":"2023-04-21T09:02:40","date_gmt":"2023-04-21T09:02:40","guid":{"rendered":"https:\/\/www.cryptocabaret.com\/?p=72838"},"modified":"2023-04-21T09:02:40","modified_gmt":"2023-04-21T09:02:40","slug":"how-i-teach-python-with-open-source-tools","status":"publish","type":"post","link":"https:\/\/www.cryptocabaret.com\/?p=72838","title":{"rendered":"How I teach Python with open source tools"},"content":{"rendered":"<p><span class=\"field field--name-title field--type-string field--label-hidden\">How I teach Python with open source tools<\/span><br \/>\n<span class=\"field field--name-uid field--type-entity-reference field--label-hidden\"><a title=\"View user profile.\" href=\"https:\/\/opensource.com\/users\/don-watkins\" class=\"username\">Don Watkins<\/a><\/span><br \/>\n<span class=\"field field--name-created field--type-created field--label-hidden\">Fri, 04\/21\/2023 &#8211; 03:00<\/span><\/p>\n<div class=\"clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item\">\n<p>I love to teach Python. I start by beginning where the learner begins. My first question is, &#8220;How would you like to learn Python?&#8221;<\/p>\n<p>They usually answer, &#8220;What&#8217;s Python?&#8221;<\/p>\n<p>That&#8217;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, <a href=\"https:\/\/developers.redhat.com\/blog\/2019\/09\/27\/python-wheels-ai-ml-and-abi-compatibility?intcmp=7013a000002qLH8AAM\" target=\"_blank\" rel=\"noopener\">artificial intelligence and machine learning<\/a>.<\/p>\n<p>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.<\/p>\n<pre>\n<code class=\"language-python\">&gt;&gt;&gt; print(\"Hello World\")\nHello World<\/code><\/pre>\n<p>Unless they are Linux or macOS users, they might need help <a href=\"https:\/\/opensource.com\/article\/19\/8\/how-install-python-windows\">installing Python on their computer<\/a>. I guide them through downloading Python from the <a href=\"https:\/\/www.python.org\/\" target=\"_blank\" rel=\"noopener\">Python.org<\/a> website and installing it on their computer. Next, I help them set up a development environment. For many users this is <a href=\"https:\/\/opensource.com\/article\/17\/10\/python-101\">IDLE<\/a>.<\/p>\n<\/p>\n<div class=\"callout-float-right embedded-resource-list\" data-analytics-region=\"sidebar\">\n<div class=\"field field--name-title field--type-string field--label-hidden field__item\">More Python resources<\/div>\n<div class=\"field field--name-links field--type-link field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/www.redhat.com\/en\/topics\/middleware\/what-is-ide?intcmp=7016000000127cYAAQ\" data-analytics-category=\"resource list\" data-analytics-text=\"What is an IDE?\">What is an IDE?<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/cheat-sheet-python-37-beginners?intcmp=7016000000127cYAAQ\" data-analytics-category=\"resource list\" data-analytics-text=\"Cheat sheet: Python 3.7 for beginners\">Cheat sheet: Python 3.7 for beginners<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/resources\/python\/gui-frameworks?intcmp=7016000000127cYAAQ\" data-analytics-category=\"resource list\" data-analytics-text=\"Top Python GUI frameworks\">Top Python GUI frameworks<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/7-essential-pypi-libraries?intcmp=7016000000127cYAAQ\" data-analytics-category=\"resource list\" data-analytics-text=\"Download: 7 essential PyPI libraries\">Download: 7 essential PyPI libraries<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/developers.redhat.com\/?intcmp=7016000000127cYAAQ\" data-analytics-category=\"resource list\" data-analytics-text=\"Red Hat Developers\">Red Hat Developers<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/console.redhat.com\/?intcmp=7016000000127cYAAQ\" data-analytics-category=\"resource list\" data-analytics-text=\"Register for your free Red Hat account\">Register for your free Red Hat account<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/python?intcmp=7016000000127cYAAQ\" data-analytics-category=\"resource list\" data-analytics-text=\"Latest Python articles\">Latest Python articles<\/a><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<h2>A good Python IDE<\/h2>\n<p>For a young student, I introduce <a href=\"https:\/\/opensource.com\/article\/20\/9\/teach-python-mu\">Mu<\/a>, a great development environment for elementary and middle school students. Adults and older students might use <a href=\"https:\/\/opensource.com\/article\/20\/6\/open-source-alternatives-vs-code#vscodium\">VSCodium<\/a>.<\/p>\n<h2>Python REPL<\/h2>\n<p>I often introduce new users to the <a href=\"https:\/\/codewith.mu\/en\/tutorials\/1.2\/repl\" target=\"_blank\" rel=\"noopener\">REPL<\/a> so they can execute their code easily. Then I show them how to write a simple program with a print statement <code>print(\"Hello World\")<\/code> and save it as a text file with a <code>.py<\/code> extension. I explain that the <code>.py<\/code> extension is necessary for Python to recognize the program.<\/p>\n<h2>Turtle<\/h2>\n<p>Then I introduce them to Python fundamentals, including variables, strings, numbers, and basic operations. I suggest Python libraries like the <a href=\"https:\/\/opensource.com\/life\/15\/8\/python-turtle-graphics\">Turtle<\/a>, which even adults find fascinating. I start simply in the REPL:<\/p>\n<pre>\n<code class=\"language-python\">import turtle  \nturtle.forward(100)\nturtle.right(90)<\/code><\/pre>\n<p>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:<\/p>\n<pre>\n<code class=\"language-python\">import turtle\nturtle.forward(100)\nturtle.right(90)\nturtle.forward(100)\nturtle.right(90)\nturtle.forward(100)\nturtle.right(90)\nturtle.forward(100)\nturtle.right(90)<\/code><\/pre>\n<p>Then I cover control structures like the <strong>if<\/strong> statement, <strong>elif<\/strong>, <strong>for<\/strong>, and <strong>while<\/strong>. I demonstrate drawing that same square quickly and easily with a <strong>for<\/strong> loop:<\/p>\n<pre>\n<code class=\"language-python\">import turtle\nfor x in range(4):\n    turtle.forward(100)\n    turtle.right(90)<\/code><\/pre>\n<h2>Teaching Python is a gift<\/h2>\n<p>When you teach, it&#8217;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.<\/p>\n<p>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.<\/p>\n<\/div>\n<div class=\"clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item\">\n<p>Teaching Python to others is easy with these open source tools and techniques.<\/p>\n<\/div>\n<div class=\"field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item\">\n<article class=\"media media--type-image media--view-mode-caption\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2023\/04\/EDU_OSDC_BYU_520x292_FINAL.png\" width=\"520\" height=\"292\" alt=\"How to do open research: 5 basic principles\" title=\"How to do open research: 5 basic principles\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>Opensource.com<\/p>\n<\/div>\n<\/article>\n<\/div>\n<div class=\"field field--name-field-tags field--type-entity-reference field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/python\" hreflang=\"en\">Python<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/education\" hreflang=\"en\">Education<\/a><\/div>\n<\/p><\/div>\n<div class=\"field field--name-field-listicle-title field--type-string field--label-hidden field__item\">What to read next<\/div>\n<div class=\"field field--name-field-listicles field--type-entity-reference field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/article\/21\/6\/teach-python-raspberry-pi\" hreflang=\"und\">How I teach Python on the Raspberry Pi 400 at the public library<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/article\/20\/9\/my-students-taught-me-code\" hreflang=\"und\">How my students taught me to code<\/a><\/div>\n<\/p><\/div>\n<div class=\"field field--name-field-default-license field--type-list-string field--label-hidden field__item\"><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><br \/>\n        <img decoding=\"async\" alt=\"Creative Commons License\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2023\/04\/cc-by-sa--31.png\" title=\"This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.\"><\/a>This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.<\/div>\n<section class=\"field field--name-field-comments field--type-comment field--label-hidden comment-wrapper\">\n<div class=\"comments__count\">\n<div class=\"login\"><a href=\"https:\/\/opensource.com\/user\/register?absolute=1\">Register<\/a> or <a href=\"https:\/\/opensource.com\/user\/login?current=\/feed&amp;absolute=1\">Login<\/a> to post a comment.<\/div>\n<\/p><\/div>\n<\/section>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\" rel=\"noopener\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How I teach Python with open source tools Don Watkins Fri, 04\/21\/2023 &#8211; 03:00 I love to teach Python. I start by beginning where the learner begins. My first question is, &#8220;How would you like to learn Python?&#8221; They usually answer, &#8220;What&#8217;s Python?&#8221; That&#8217;s when I give them some examples of websites built with Python [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":72839,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[307],"tags":[],"class_list":["post-72838","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source"],"_links":{"self":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/72838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72838"}],"version-history":[{"count":0,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/72838\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/media\/72839"}],"wp:attachment":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}