Skip to content

Commit b15539c

Browse files
committed
Merge branch 'master' of https://github.com/CoderDojoTC/python
2 parents 47ebaf0 + 2273305 commit b15539c

34 files changed

+495
-453
lines changed

.github/workflows/main.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,34 @@ on:
88
pull_request:
99
branches: [master]
1010

11+
env:
12+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
13+
14+
permissions:
15+
contents: 'write'
16+
id-token: 'write'
17+
pull-requests: 'write'
1118
jobs:
1219
build:
1320
name: Build and Deploy Documentation
1421
runs-on: ubuntu-latest
22+
1523
steps:
24+
- name: Checkout Branch
25+
uses: actions/checkout@v3
26+
if: github.event_name == 'pull_request'
27+
with:
28+
fetch-depth: 0
29+
ref: ${{ github.event.pull_request.head.ref }}
30+
persist-credentials: false
31+
1632
- name: Checkout Master
17-
uses: actions/checkout@v2
33+
uses: actions/checkout@v3
34+
35+
if: github.event_name == 'push'
36+
with:
37+
fetch-depth: 0
38+
persist-credentials: false
1839

1940
- name: Set up Python 3.7
2041
uses: actions/setup-python@v2
@@ -25,7 +46,11 @@ jobs:
2546
run: |
2647
python -m pip install --upgrade pip
2748
pip install mkdocs-material
28-
49+
50+
- name: Check
51+
run: |
52+
pwd
53+
ls -la
2954
- name: Deploy
3055
run: |
3156
git pull

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"cSpell.words": [
3+
"Mojhave",
34
"Trinkit",
45
"coderdojo",
56
"jupyter",

docs/img/night_sky.png

7.47 KB
Loading

docs/img/rocketpanda.png

3.85 KB
Loading

docs/img/row-of-circles.png

12.5 KB
Loading

docs/img/stop-sign.png

9.42 KB
Loading

docs/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
# CoderDojo Twin Cities Python Resources
2-
This GitHub repository is for sharing teaching resources to teach Python. This includes hints on getting your Python environments setup up and extensive lesson plans for serveral enviornments.
2+
This GitHub repository is for sharing teaching resources to teach Python. This includes hints on getting your Python environments setup up and extensive lesson plans for several environments.
33

44

5-
Our mentors have used several different envornments for teaching Python. They each have pros and cons. What our mentors like is getting new students started using a graphical programming environment such as turtle graphics libraries. Here are some of our favorite tools:
5+
Our mentors have used several different environments for teaching Python. They each have pros and cons. What our mentors like is getting new students started using a graphical programming environment such as turtle graphics libraries. Here are some of our favorite tools:
66

77
- [**Trinket.io**](http://trinket.io) is an easy-to use, kid friendly web-based turtle graphics for beginners.
88
- [**Jupyter Notebooks**](https://jupyter.org/) also have some support for turtle graphics. Jupyter Notebooks can be tricky to setup for the first time, but they are the perfect on-ramp for teaching data literacy.
99
- [**Raspberry Pi**](https://www.raspberrypi.org/documentation/usage/python/) - The Raspberry Pi foundation has selected Python as its primary tool for teaching programming. If you have a Raspberry Pi there are many resources for you. Trinket and Jupyter Notebooks will also run on many Raspberry Pi devices.
1010
- **Robots** Our students love robots. Python is also the preferred language in many robotics courses. Today we teach beginning robotics with Scratch and Arduino, but we continue to investigate systems like Raspberry Pi robots that can be programmed with Python. Let us know if you have any low-cost kid friendly ideas. We have tested the JetBot and other robots and we continue to look for solutions.
1111

12-
Now lets briefly go into the pros and cons of these systems.
12+
Now let's briefly go into the pros and cons of these systems.
1313

1414
## Learning Python with Trinket
1515

16-
We use the [trinket.io](http://trinket.io) web site to teach our introduction to python. Trinket has a nice turtle graphics library which is ideal for fast visual feedback. Because it is a free and a pure web web based environment it meets the criteria for our courses. There is no complex setup and each student can continue to do development when they are at home. The downside of Trinket is it has limited functionality, only supports Python 2.X in the free version and you must have an internet connection to use Trinket. If you need Python 3.X web
16+
We use the [trinket.io](http://trinket.io) web site to teach our introduction to python. Trinket has a nice turtle graphics library which is ideal for fast visual feedback. Because it is a free and a pure web-based environment it meets the criteria for our courses. There is no complex setup and each student can continue to do development when they are at home. The downside of Trinket is it has limited functionality, only supports Python 2.X in the free version and you must have an internet connection to use Trinket. If you need Python 3.X web
1717
version you can use the free [repl.id](https://repl.it/) web site.
1818

1919
## Learning Python with Jupyter Notebooks
20-
You can also use Jupyter Notebooks to draw turtle graphics. The notebook will open a new window to draw your turtle graphis. Getting Jupyter Notebooks is a bit tricky to setup on many PCs. However, once it is setup it offers tens of thousands of sample programs to learn python coding. Jupyter Notebooks are also the preferred tool by many data science professionals.
20+
You can also use Jupyter Notebooks to draw turtle graphics. The notebook will open a new window to draw your turtle graphics. Getting Jupyter Notebooks is a bit tricky to setup on many PCs. However, once it is setup it offers tens of thousands of sample programs to learn python coding. Jupyter Notebooks are also the preferred tool by many data science professionals.
2121
An example of a Jupyter Notebook that uses turtle graphs is [here](jupyter/draw-figure.ipynb)
2222

2323
## Learning Python with Raspberry Pi
24-
If you have a Rasperry Pi there are many great ways to learn Python. One of first things is to try out one of the Python development environments for the Raspberry Pi.
24+
If you have a Raspberry Pi there are many great ways to learn Python. One of first things is to try out one of the Python development environments for the Raspberry Pi.
2525

2626
## Learning Python with Robots
27-
Right now we are continuing to try to find the right combination of easy-of-use and low-cost robots to teach python. If you hear of any good tools, please let us know.
27+
Right now, we are continuing to try to find the right combination of easy-of-use and low-cost robots to teach python. If you hear of any good tools, please let us know.
2828

2929
## Target Audience
3030
Learning Python is ideal for students that have good keyboarding skills. If students have difficulty with doing functions like copy and pasting text we suggest they start with a block-programming language like Scratch.
3131

3232
## List of Concepts
3333
Here are some of the concepts we will be learning in this course. If you are already familiar with these concepts you can skip over some of the labs.
3434

35-
- **importing libraries** We need to tell Pyhton what functions we want to use. We will use the import function to tell Python which functions we need to use in our programs.
35+
- **importing libraries** We need to tell Python what functions we want to use. We will use the import function to tell Python which functions we need to use in our programs.
3636
- **drawing** Turtle graphs has a set of drawing functions. We will learn to use these to draw patterns on the screen.
3737
- **square walk** - teach your turtle to walk in a square and draw figures.
3838
- **variables** Variables make our programs easier to read and easier to understand.
@@ -41,7 +41,7 @@ Here are some of the concepts we will be learning in this course. If you are al
4141
- **functions** Functions allow us to break large programs into chunks that we can give names and can call over and over.
4242
- **function parameters** Functions can also take parameters to change the behavior of a function.
4343
- **random numbers** Random number functions allow our programs to have the computer select new random number between a range of numbers.
44-
- **lists** Lists alow us to create collections of names.
44+
- **lists** Lists allow us to create collections of names.
4545
- **inputs** Inputs allow us to prompt the user for values.
4646
- **recursion** Recursion allows us to have programs call themselves to create repeating patterns.
4747
- **modules** Once you have a group of related functions you can put them all together into a module. This makes it easier for others to reuse your programs.

docs/intermediate/20-installing-local-python.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
The next few labs are labs that must be run on your local computer because the will interact with the local operating system and local file system. You will not be able to use Trinket to run these programs.
44

55
The main site for Python is here:
6-
7-
[https://www.python.org/](https://www.python.org/)
6+
[https://www.python.org/](https://www.python.org/)
87

98
If you go to that site there will be pages for Downloads and Documentation for each version of your desktop or PC.
109

@@ -44,6 +43,13 @@ for step in range(0, len(myPath)):
4443
print(step+1, myPath[step])
4544
```
4645

46+
## Using Conda Environments
47+
We use conda to keep all our Python projects separate.
48+
49+
```sh
50+
conda create -n coderdojo python=3
51+
conda activate coderdojo
52+
```
4753

4854
## Installing Python in an Integrated Development Environment (IDE)
4955

docs/intermediate/21-files.md

Lines changed: 0 additions & 122 deletions
This file was deleted.

docs/intermediate/22-images.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/trinket/00-introduction.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,20 @@ The map above is a visual guide to our Introduction to Python course. Students
1717
For students that are new to programming, here are some sample programs (what we call learning labs) that you can try. You can learn by reading the sample programs, going to the Trinkit.io site and changing some values in the code. Each of the labs has experiments at the end you can do to extend to see if you have mastered the concepts before you go on to the next lab.
1818

1919
1. [Trinket Account](./01a-trinket-account.md) - introduction to the Turtle Graphs library with a list of drawing functions
20-
1. [Turtle graphics](./01a-turtle-graphics.md) - introduction to the Turtle Graphs library with a list of drawing functions
21-
2. [Simple square](./02-simple-square.md) - draw a square by moving and turning right four times
20+
2. [Turtle graphics](./01b-turtle-graphics.md) - introduction to the Turtle Graphs library with a list of drawing functions
21+
3. [Simple square](./02-simple-square.md) - draw a square by moving and turning right four times
2222
4. [Variables](./03-variables.md) - add variables for the move edge distance and angle
2323
5. [Loops](./04-loops.md) - add a loop to make our code smaller
2424
6. [Conditionals](./05-conditionals.md) - add an if statement to change the color
2525
7. [Functions](./06-functions.md) - create a shape function
2626
8. [Function parameters](./07-function-parameters.md) - add parameters to our function
2727
9. [Random](./08-random.md) - generate random numbers that are used do drive the turtle
28-
9. [Lists](./08-list.md) - store a list of colors
29-
10. [Inputs](./11-input.md) - get some input from the user
30-
11. [Recursion](./12-recursion.md) - create a function that calls itself to draw a tree
31-
28+
10. [Lists](./08-list.md) - store a list of colors
29+
11. [Inputs](./11-input.md) - get some input from the user
30+
12. [Recursion](./12-recursion.md) - create a function that calls itself to draw a tree
31+
13. [Shapes](./13-shape-module.md) - creating a separate module to draw shapes
32+
14. [Color picker](./14-color-picker.md) - picking different colors
33+
15. [Sine wave](./15-sine-wave.md) - creating a sine wave
34+
16. [Changing Background](./16-changing-background.md) - changing background image and capturing keyboard
35+
17. [Controlling MouseClicks](./17-controlling-mouseclicks.md) - Tracking mouse clicks
3236

docs/trinket/02-simple-square.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Here is a link to the Trinket web site with this program running:
2828
[https://trinket.io/python/564899ffe9](https://trinket.io/python/564899ffe9)
2929
You can click on this link and then press the Run button. You should see the python code on the left side and the drawing on the right side of your screen.
3030

31-
## Explaination
31+
## Explanation
3232
The first three lines will be the same for all our programs. They import the turtle library into our program, create a new turtle object and then assign the turtle a shape icon. Although almost all the turtle libraries work this way, there are some minor differences you will see in future examples.
3333

34-
## Reorinenting your turtle
35-
Note that at the start, the turtle is facing to the right. After the last instruction, it is also facing to the right. This is a common best practice so that the turtle gets reoriented after some drawing function. If you remove the last right(90) function and run the program again you will see the turtle ends up facing upward. But if you rerun the progam you will still get the same square because the orientation of the turtle is not stored between runs.
34+
## Reorienting your turtle
35+
Note that at the start, the turtle is facing to the right. After the last instruction, it is also facing to the right. This is a common best practice so that the turtle gets reoriented after some drawing function. If you remove the last right(90) function and run the program again you will see the turtle ends up facing upward. But if you rerun the program you will still get the same square because the orientation of the turtle is not stored between runs.
3636

3737
## Experiments
3838
Can you change the distance and angle the turtle moves? What happens when you change the numbers for the forward and right functions? Can you go left as well as right?

0 commit comments

Comments
 (0)