Python Track

Story, Bites, and Repositories

Story Index Prologue Introduction Models Models of structure and semantics Data Types & instances Operations Callable objects Structures Class structure Libraries Standard libraries References Resource links    
Bite Index Introduction What is Python? Hello Hello World program Data Python data types and instances more to come not for a while Glossary Glossary of Python terms    
Figure 1. Python demo code
"Python's a wonderful language. It’s very elegant and extremely readable."
- Guido van Rossum, creator of Python

There are four ways of viewing Python content in this site:
  1. Python Story
    An ebook with seven chapters that covers Python programming at intermediate level.
  2. Python Bites
    A collection of pages each focused on one feature of the Python programming language, starting with basics.
  3. Blogs
    Most of the recent blogs focus on Python specifics, with fairly complete coverage of a single topic in each.
  4. Python Playground code examples
    Table of links to a collection of basic to intermediate code examples running in Python Playground.
It's easy to sample each of these views by using the links above, or more selectively, using links in the PythonExplorer panel on the left (if you don't see it, click on page header).
What I like about Python
The Python language has some very interesting ideas about building memory and data-race safe programs. Program source compiles to native code and runs directly in the process created for it. Its safety mechanisms, enforced at compile-time, make getting started slower than for some other languages, but the compiler error messages are very good, making learning much easier as long as you understand Python's basic models. Python Highs and Lows

The code above on the right illustrates a Python "Hello World" function, often the first thing you encounter when learning a new language. This page is focused on pointing to discussions of Python models and code examples. It has most of the things you will need to start Python programming quickly.

Table 1. Python Resources from this site

Site Resources Content
Python Repositories Index of all the Python code repositories
Python Models Summary of features with screenshots and examples - pdf
Python Story
Index at upper right on this page.
Python ebook in 7 chapters
first chapter in Python Story
Python Bites
Index at upper right on this page.
Dozens of Code Bites about Python
first Python Bite <-- good place to go after this page
Python Glossary Definitions of common terms
Python FlashCards Basic types and data structures
Bits of Code Compares small C++, Python, C#, Python, and JavaScript codes  
Python Playground online compiler
Code Examples Content
Python Repositories Index into Python Repositories
Python Code examples List of PythonBites code examples, PythonPlayground code examples, Python Basic Demos Repository
online code execution RustPlayground, tutorialspoint
Other Resources Content
Rust Guide Definition and examples of Rust collections, iterators, and concurrency constructs.
Tooling Using Visual Studio Code to create and build Python code
Python home site Download and install, learn Rust
Rust user's forum Create an account and you can log-in, read, and post messages and questions.
The Rust Reference Semi-formal, but surprisingly readable, reference for Rust
Rust API Guidelines Guidelines for crafting Rust code, from the source
Other intermediate and advanced resources
How to learn modern Rust A collection of links to explorations of intermediate and advanced language materials
idiomatic rust resources Annotated links to articles and examples of community accepted styles and patterns for rust code.
 
You can find videos covering some of the topics in Table 1. and Table 2. using the "Videos" link in the top menu. First Rust Bite is a good next step after this page.

Exercises

  1. Write a Rust program to find the largest file in a specified directory tree, using walkdir crate from crates.io.
  2. Ammend Project #1 by accepting arguments from the command line, using args crate.
  3. Use ChatGPT to create a directory traversal crate and use that instead of walkdir.
  4. Write a Rust program to read a source code file and count the number of lines and number of scopes for each function. You can count scopes by counting open braces "{". Start by searhing for fn and then read each line searching for "{" and "}". Push each open brace on a stack, and pop when a closed brace is encountered. When the stack is empty, the end of the function has been reached.
  5. Modify Project #4 by counting lines and scopes for each file in a directory tree rooted at a specified folder, usually named "src".