back to school... "1/3" --> float question, just eval?
Here's a thread I'm starting with my campers taking a PyCamp course. Yesterday we were co-evolving a calculator driven by looping menu. It does squares and square roots (one of the campers supplied this logic) and I was just getting around to introducing the y^x key as some call it, i.e. any number to any power, Python's pow(num, exp). Today we'll pick up where we left off. We used the shared whiteboard to draw radical signs as I intoned about how pow(3, 3) means like ```3 * 3 * 3```. Math Adventures in Python. We might also say ```3 ** 3``` (and not ```3^3``` like in so many languages). sqrt(num) is the same as ```num ** (1/2)``` and we can get the 3rd root of 27 with ```27 ** (1/3)```. [ Sorry for all the markdown by the way, if you're getting a plaintext version -- an option I'd advocate for browser based viewers of the archives someday (to see what it looked like way back when, Before Markdown). ] So here's what we're up against: say I want to raise 10 to the 1/3rd power, same as taking a "cube root" of 10 (tetrahedral whatever). The menu prompts: ```python num = float(input("Your number please: > ")) # yes a bit dangerous exp = float(input("...and your exponent: > ")) # user wants to do 1/3 ``` Of course that last statement raises an exception because float("1/3") doesn't work (isn't supposed to). What shall we do then? I'm thinking we parse anything that looks like a legal fraction and do the floating point conversion from int(p)/int(q). We won't allow input like 2.1/3.6 just int/int. I've already preached against eval() but if it passes my regular expression test first... Anyway, it's a discussion. These are like middle schoolers previewing high school, at a time when kid focused code schools were under some pressure to convert to "everything online". I used to drive to the schools. We don't have to use a regexp! A good excuse to say what these are though. Or test for the pattern but then use split("/") to pry numerator from denominator, once we know that'll work? https://github.com/4dsolutions/python_camp/blob/master/camper_program.py (snapshot -- part of the camp is they watch me git pushing updates to the camp repo). Rather perversely, I may set things back between camps i.e. I'll deliberately revert the code. Comments? Code? Kirby PS: I notice Python 3.8 is being rather more generous in its statistics module. Campers who wander from the base camp fire are likely to find themselves staring at pdfs and cdfs.
On Thu, Apr 9, 2020 at 2:02 PM kirby urner <kirby.urner@gmail.com> wrote:
Here's a thread I'm starting with my campers taking a PyCamp course.
Yesterday we were co-evolving a calculator driven by looping menu. It does squares and square roots (one of the campers supplied this logic) and I was just getting around to introducing the y^x key as some call it, i.e. any number to any power, Python's pow(num, exp).
Today we'll pick up where we left off.
We used the shared whiteboard to draw radical signs as I intoned about how pow(3, 3) means like ```3 * 3 * 3```. Math Adventures in Python. We might also say ```3 ** 3``` (and not ```3^3``` like in so many languages). sqrt(num) is the same as ```num ** (1/2)``` and we can get the 3rd root of 27 with ```27 ** (1/3)```.
[ Sorry for all the markdown by the way, if you're getting a plaintext version -- an option I'd advocate for browser based viewers of the archives someday (to see what it looked like way back when, Before Markdown). ]
So here's what we're up against: say I want to raise 10 to the 1/3rd power, same as taking a "cube root" of 10 (tetrahedral whatever). The menu prompts:
```python
num = float(input("Your number please: > ")) # yes a bit dangerous exp = float(input("...and your exponent: > ")) # user wants to do 1/3 ```
Of course that last statement raises an exception because float("1/3") doesn't work (isn't supposed to). What shall we do then?
Try the following: from fractions import Fraction float(Fraction("1/3")) Knowing you, I'm sure you can figure out plenty of useful applications of this. :-) André
I'm thinking we parse anything that looks like a legal fraction and do the floating point conversion from int(p)/int(q). We won't allow input like 2.1/3.6 just int/int. I've already preached against eval() but if it passes my regular expression test first...
Anyway, it's a discussion. These are like middle schoolers previewing high school, at a time when kid focused code schools were under some pressure to convert to "everything online". I used to drive to the schools.
We don't have to use a regexp! A good excuse to say what these are though. Or test for the pattern but then use split("/") to pry numerator from denominator, once we know that'll work?
https://github.com/4dsolutions/python_camp/blob/master/camper_program.py (snapshot -- part of the camp is they watch me git pushing updates to the camp repo).
Rather perversely, I may set things back between camps i.e. I'll deliberately revert the code.
Comments? Code?
Kirby
PS: I notice Python 3.8 is being rather more generous in its statistics module. Campers who wander from the base camp fire are likely to find themselves staring at pdfs and cdfs. _______________________________________________ Edu-sig mailing list -- edu-sig@python.org To unsubscribe send an email to edu-sig-leave@python.org https://mail.python.org/mailman3/lists/edu-sig.python.org/
Try the following:
from fractions import Fraction float(Fraction("1/3"))
Knowing you, I'm sure you can figure out plenty of useful applications of this. :-)
André
A totally excellent suggestion! I'm going to share that, by bringing campers here on tour, saying "this is where Python educators hang out!" Maybe some of them will want to join us someday. Kirby
Are there unit tests for the supported operations? Is the UI logic a separate testable unit? Does it just fatal exception when parsing fails; or does the REPL loop catch the e.g. Value error? Instead of a CLI eval wrapper with regex, you could use ipywidgets in a notebook: https://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20List.html You can pair a notebook to a markdown file with jupytext so that the notebook autosaves as markdown, which works with mailman 3 mailing list archives On Thu, Apr 9, 2020, 1:44 PM kirby urner <kirby.urner@gmail.com> wrote:
Try the following:
from fractions import Fraction float(Fraction("1/3"))
Knowing you, I'm sure you can figure out plenty of useful applications of this. :-)
André
A totally excellent suggestion!
I'm going to share that, by bringing campers here on tour, saying "this is where Python educators hang out!"
Maybe some of them will want to join us someday.
Kirby
_______________________________________________ Edu-sig mailing list -- edu-sig@python.org To unsubscribe send an email to edu-sig-leave@python.org https://mail.python.org/mailman3/lists/edu-sig.python.org/
Should've re-read your first message before I replied: - "CLN: camper_program.py: Cleanup camper program codestyle with black and pyflakes" https://github.com/4dsolutions/python_camp/pull/3 - "TST: camper_program.py: tests and exception handlin" https://github.com/4dsolutions/python_camp/pull/4 - IDK if camper_program_with_tests.py or camper_program_pro.py would be more or less helpful than just reviewing the (commits in the) PR https://github.com/4dsolutions/python_camp/blob/master/PyCampNextLevel.ipynb - Git - https://learngitbranching.js.org/ is an excellent interactive resource for learning git - Password Hashes - argon2 is a chosen cryptographic hash function: https://en.wikipedia.org/wiki/Argon2 - Django now defaults to PBKDF2 https://docs.djangoproject.com/en/3.0/topics/auth/passwords/#how-django-stor... - https://en.wikipedia.org/wiki/Hashcat is really fast at password hashing - Bitcoin has a number of SHA256 implementations; that may be the fastest int eh whole world - https://github.com/bitcoin/bitcoin/tree/master/src/crypto - https://github.com/bitcoin/bitcoin/blob/master/src/crypto/sha256.cpp - "Dumbcoin - An educational python implementation of a bitcoin-like blockchain" https://github.com/julienr/ipynb_playground/blob/master/bitcoin/dumbcoin/dum... - https://en.wikipedia.org/wiki/Hyperledger#Members_and_governance On Thu, Apr 9, 2020 at 10:30 PM Wes Turner <wes.turner@gmail.com> wrote:
Are there unit tests for the supported operations? Is the UI logic a separate testable unit? Does it just fatal exception when parsing fails; or does the REPL loop catch the e.g. Value error?
Instead of a CLI eval wrapper with regex, you could use ipywidgets in a notebook: https://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20List.html
You can pair a notebook to a markdown file with jupytext so that the notebook autosaves as markdown, which works with mailman 3 mailing list archives
On Thu, Apr 9, 2020, 1:44 PM kirby urner <kirby.urner@gmail.com> wrote:
Try the following:
from fractions import Fraction float(Fraction("1/3"))
Knowing you, I'm sure you can figure out plenty of useful applications of this. :-)
André
A totally excellent suggestion!
I'm going to share that, by bringing campers here on tour, saying "this is where Python educators hang out!"
Maybe some of them will want to join us someday.
Kirby
_______________________________________________ Edu-sig mailing list -- edu-sig@python.org To unsubscribe send an email to edu-sig-leave@python.org https://mail.python.org/mailman3/lists/edu-sig.python.org/
Thank you very much for the pull requests Wes! I got notification by email. They may be against a version that no longer exists, but no matter. We're gonna poke around live on camera, starting in about 30 minutes. We go for 2.25 hours with one or two breaks. I'm taking my campers right into my mailbox and showing through Github how it all might work, even if I don't actually make it work. I've got the Daniel Shiffman "Git for Poets" playlist queued up through [the main Notebook]( https://github.com/4dsolutions/python_camp/blob/master/PyCampNextLevel.ipynb ). Providing opportunities to soak up knowledge about Git and Github has been a primary focus of this camp. My two cohorts so far have differed quite a bit in character. The first group featured teens eager to dive into deep topics, per the camp blurb, and got antsy when I didn't talk machine learning right away. This might be too much a camp for noobs. I didn't have the Jupyter Notebook four day outline yet. They're nervousness is partly what drove me to get it out there, reassure them our content would match the camp description. The second group is younger, considers itself adept and into programming, yet is patiently learning a lot of core Python. One camper had worked with his dad on solving that "1/3 --> float" problem. I incorporated their code verbatim as a part of our shared process. I've never shared about the construct manager construct with like middle schoolers before, however that's a big part of the plan for today. I [showcase that construct]( https://github.com/4dsolutions/python_camp/blob/master/ContextManager.ipynb) for connecting to / working with / disconnecting from databases (in our case sqlite3 databases). I tell them they're previewing the high school of tomorrow. The School of Tomorrow is a neighboring repo, and crosslinks (hyperlinks) between that, and this camp, have already appeared. My recommendation to campers starting from day one is they: (a) install git locally (b) git clone the camp repo (c) create a Github account (d) fork the camp repo (e) git clone the forked camp repo Then they should treat the (b) structure as something to keep updating with git pull. Treat my version of the repo as read-only. However, they can modify and elaborate on their own version of the forked repo (e), and push changes at will. Harvest ideas from my updates for their own works in progress. Share links to their own repos through Zoom chat. My schedule is such that I'm expected on more week of piloting this curriculum, then shelving it to work on something more data science oriented, returning to the kid camp scene in early June. I'll be looking for ideas on how a strong data science course should go, assuming beginners but with some Python experience. Obviously we'll be using numpy, matplotlib, sklearn and like that. Kirby
On Fri, Apr 10, 2020 at 4:40 PM kirby urner <kirby.urner@gmail.com> wrote:
Thank you very much for the pull requests Wes! I got notification by email.
They may be against a version that no longer exists, but no matter. We're gonna poke around live on camera, starting in about 30 minutes. We go for 2.25 hours with one or two breaks.
Cool. Good timing
I'm taking my campers right into my mailbox and showing through Github how it all might work, even if I don't actually make it work.
I've got the Daniel Shiffman "Git for Poets" playlist queued up through [the main Notebook]( https://github.com/4dsolutions/python_camp/blob/master/PyCampNextLevel.ipynb ).
Providing opportunities to soak up knowledge about Git and Github has been a primary focus of this camp.
GitHub has resources for learning Git and GitHub: https://try.github.io/ https://lab.github.io/ I can't recommend Learn Git Branching enough: https://learngitbranching.js.org/
My two cohorts so far have differed quite a bit in character.
The first group featured teens eager to dive into deep topics, per the camp blurb, and got antsy when I didn't talk machine learning right away. This might be too much a camp for noobs. I didn't have the Jupyter Notebook four day outline yet. They're nervousness is partly what drove me to get it out there, reassure them our content would match the camp description.
https://jakevdp.github.io/PythonDataScienceHandbook/ https://github.com/jakevdp/PythonDataScienceHandbook - Launch in Binder, Colab links
The second group is younger, considers itself adept and into programming, yet is patiently learning a lot of core Python. One camper had worked with his dad on solving that "1/3 --> float" problem. I incorporated their code verbatim as a part of our shared process.
IMHO, your strategy for finding answers to questions is maybe the most important aspect of learning to code: - find the docs and bookmark them - find the source and bookmark it - list every possible word for the thing you're describing - try adding "double quotes" around certain terms and error messages - exclude with minus: -"this or that" ### Mailing Lists - Google search with "site:mail.python.org" and/or "inurl:" queries https://www.google.com/search?q=site%3Amail.python.org (inurl doesn't match mm3-migrated lists too) - Google Groups, if the list is set up there too - Gmail "list:python.org" queries - This doesn't find messages that you didn't receive because you weren't subscribed yet. - Gmail "from:list@mail.python.org" queries - This doesn't find messages that you didn't receive because you weren't subscribed yet. - Markmai:l "list:org.python.edu-sig" queries https://markmail.org/search/?q=list%3Aorg.python https://markmail.org/search/?q=list%3Aorg.python.edu-sig [1] "[Edu-sig] Learning Code IRC for kids?" [2] "REQ: HOWTO mailing lists resources"
I've never shared about the construct manager construct with like middle schoolers before, however that's a big part of the plan for today. I [showcase that construct]( https://github.com/4dsolutions/python_camp/blob/master/ContextManager.ipynb) for connecting to / working with / disconnecting from databases (in our case sqlite3 databases). I tell them they're previewing the high school of tomorrow.
Is this how context managers work? ```python class MyManager: def __enter__(*args, **kwargs): print("entering") print((args, kwargs)) def __exit__(*args, **kwargs): print("exiting") def hello(*args, **kwargs): print("hello") with MyManager(1, two="three") as mgr: mgr.hello() ``` https://www.google.com/search?client=firefox-b-1-d&q=site%3Adocs.python.org+context+manager - https://docs.python.org/3/reference/datamodel.html#with-statement-context-ma... Can't remember whether args go to __init__ to __enter__
The School of Tomorrow is a neighboring repo, and crosslinks (hyperlinks) between that, and this camp, have already appeared.
My recommendation to campers starting from day one is they:
(a) install git locally (b) git clone the camp repo (c) create a Github account (d) fork the camp repo (e) git clone the forked camp repo
Then they should treat the (b) structure as something to keep updating with git pull. Treat my version of the repo as read-only.
So you have two working directories; instead of one working directory with multiple remotes (git remote -v) In my .gitconfig, I have an `r` alias, so I can just type `git r` and it runs `git remote -v`: https://github.com/westurner/dotfiles/blob/master/etc/.gitconfig
However, they can modify and elaborate on their own version of the forked repo (e), and push changes at will. Harvest ideas from my updates for their own works in progress. Share links to their own repos through Zoom chat.
Do you give feedback with pull requests? AFAIU, GitHub Classroom improves the PR for feedback workflow tremendously.
My schedule is such that I'm expected on more week of piloting this curriculum, then shelving it to work on something more data science oriented, returning to the kid camp scene in early June. I'll be looking for ideas on how a strong data science course should go, assuming beginners but with some Python experience. Obviously we'll be using numpy, matplotlib, sklearn and like that.
https://github.com/trending/jupyter-notebook My notes w/ links and resources for data science: https://wrdrd.github.io/docs/consulting/data-science#
Kirby
_______________________________________________ Edu-sig mailing list -- edu-sig@python.org To unsubscribe send an email to edu-sig-leave@python.org https://mail.python.org/mailman3/lists/edu-sig.python.org/
That link to GitHub Learning Lab should be: https://lab.github.com/ - https://lab.github.com/githubtraining/introduction-to-github (57m) - https://lab.github.com/githubtraining/github-actions:-continuous-integration (171m) - https://lab.github.com/githubtraining/continuous-integration-with-travis-ci (79m) - You can generate a whole project skeleton with CI, tests, and all in like 2 minutes: pip install cookiecutter cookiecutter https://github.com/audreyr/cookiecutter-pypackage cookiecutter gh:audreyr/cookiecutter-pypackage cookiecutter https://github.com/drivendata/cookiecutter-data-science - https://lab.github.com/githubtraining/create-a-release-based-workflow (90m) On Fri, Apr 10, 2020 at 5:52 PM Wes Turner <wes.turner@gmail.com> wrote:
On Fri, Apr 10, 2020 at 4:40 PM kirby urner <kirby.urner@gmail.com> wrote:
Thank you very much for the pull requests Wes! I got notification by email.
They may be against a version that no longer exists, but no matter. We're gonna poke around live on camera, starting in about 30 minutes. We go for 2.25 hours with one or two breaks.
Cool. Good timing
I'm taking my campers right into my mailbox and showing through Github how it all might work, even if I don't actually make it work.
I've got the Daniel Shiffman "Git for Poets" playlist queued up through [the main Notebook]( https://github.com/4dsolutions/python_camp/blob/master/PyCampNextLevel.ipynb ).
Providing opportunities to soak up knowledge about Git and Github has been a primary focus of this camp.
GitHub has resources for learning Git and GitHub: https://try.github.io/ https://lab.github.io/
I can't recommend Learn Git Branching enough: https://learngitbranching.js.org/
My two cohorts so far have differed quite a bit in character.
The first group featured teens eager to dive into deep topics, per the camp blurb, and got antsy when I didn't talk machine learning right away. This might be too much a camp for noobs. I didn't have the Jupyter Notebook four day outline yet. They're nervousness is partly what drove me to get it out there, reassure them our content would match the camp description.
https://jakevdp.github.io/PythonDataScienceHandbook/ https://github.com/jakevdp/PythonDataScienceHandbook - Launch in Binder, Colab links
The second group is younger, considers itself adept and into programming, yet is patiently learning a lot of core Python. One camper had worked with his dad on solving that "1/3 --> float" problem. I incorporated their code verbatim as a part of our shared process.
IMHO, your strategy for finding answers to questions is maybe the most important aspect of learning to code:
- find the docs and bookmark them - find the source and bookmark it - list every possible word for the thing you're describing - try adding "double quotes" around certain terms and error messages - exclude with minus: -"this or that"
### Mailing Lists - Google search with "site:mail.python.org" and/or "inurl:" queries https://www.google.com/search?q=site%3Amail.python.org (inurl doesn't match mm3-migrated lists too) - Google Groups, if the list is set up there too - Gmail "list:python.org" queries - This doesn't find messages that you didn't receive because you weren't subscribed yet. - Gmail "from:list@mail.python.org" queries - This doesn't find messages that you didn't receive because you weren't subscribed yet. - Markmai:l "list:org.python.edu-sig" queries https://markmail.org/search/?q=list%3Aorg.python https://markmail.org/search/?q=list%3Aorg.python.edu-sig
[1] "[Edu-sig] Learning Code IRC for kids?" [2] "REQ: HOWTO mailing lists resources"
I've never shared about the construct manager construct with like middle schoolers before, however that's a big part of the plan for today. I [showcase that construct]( https://github.com/4dsolutions/python_camp/blob/master/ContextManager.ipynb) for connecting to / working with / disconnecting from databases (in our case sqlite3 databases). I tell them they're previewing the high school of tomorrow.
Is this how context managers work?
```python class MyManager: def __enter__(*args, **kwargs): print("entering") print((args, kwargs))
def __exit__(*args, **kwargs): print("exiting")
def hello(*args, **kwargs): print("hello")
with MyManager(1, two="three") as mgr: mgr.hello() ```
https://www.google.com/search?client=firefox-b-1-d&q=site%3Adocs.python.org+context+manager - https://docs.python.org/3/reference/datamodel.html#with-statement-context-ma...
Can't remember whether args go to __init__ to __enter__
The School of Tomorrow is a neighboring repo, and crosslinks (hyperlinks) between that, and this camp, have already appeared.
My recommendation to campers starting from day one is they:
(a) install git locally (b) git clone the camp repo (c) create a Github account (d) fork the camp repo (e) git clone the forked camp repo
Then they should treat the (b) structure as something to keep updating with git pull. Treat my version of the repo as read-only.
So you have two working directories; instead of one working directory with multiple remotes (git remote -v)
In my .gitconfig, I have an `r` alias, so I can just type `git r` and it runs `git remote -v`: https://github.com/westurner/dotfiles/blob/master/etc/.gitconfig
However, they can modify and elaborate on their own version of the forked repo (e), and push changes at will. Harvest ideas from my updates for their own works in progress. Share links to their own repos through Zoom chat.
Do you give feedback with pull requests? AFAIU, GitHub Classroom improves the PR for feedback workflow tremendously.
My schedule is such that I'm expected on more week of piloting this curriculum, then shelving it to work on something more data science oriented, returning to the kid camp scene in early June. I'll be looking for ideas on how a strong data science course should go, assuming beginners but with some Python experience. Obviously we'll be using numpy, matplotlib, sklearn and like that.
https://github.com/trending/jupyter-notebook
My notes w/ links and resources for data science: https://wrdrd.github.io/docs/consulting/data-science#
Kirby
_______________________________________________ Edu-sig mailing list -- edu-sig@python.org To unsubscribe send an email to edu-sig-leave@python.org https://mail.python.org/mailman3/lists/edu-sig.python.org/
Here's the list of cookiecutters: https://cookiecutter.readthedocs.io/en/latest/README.html#a-pantry-full-of-c... https://github.com/cookiecutter/cookiecutter#a-pantry-full-of-cookiecutters One great thing about starting with a cookiecutter is you don't need to understand how it all works; `make test` just works, you can configure CI (with e.g. .travis.yml and tox.ini) and it just works. It should be pretty easy to create a cookiecutter (or just add a conditional to the pypackage template) that's setup for GitHub Actions: https://help.github.com/en/actions GitHub Classroom builds upon the Pull Request workflow and GitHub Actions CI (Continuous Integration) https://classroom.github.com/classrooms In lieu of explaning how to configure jupytext so that pull request diffs of notebook.py files are more readable than the notebook.ipynb JSON, https://jupyterhub.github.io/nbgitpuller/ is ~free, nbgrader is ~free, CoCalc Courses includes nbgrader and is free https://cocalc.com/doc/teaching.html https://cocalc.com/doc/compare.html On Fri, Apr 10, 2020 at 6:34 PM Wes Turner <wes.turner@gmail.com> wrote:
That link to GitHub Learning Lab should be: https://lab.github.com/ - https://lab.github.com/githubtraining/introduction-to-github (57m) - https://lab.github.com/githubtraining/github-actions:-continuous-integration (171m) - https://lab.github.com/githubtraining/continuous-integration-with-travis-ci (79m) - You can generate a whole project skeleton with CI, tests, and all in like 2 minutes: pip install cookiecutter cookiecutter https://github.com/audreyr/cookiecutter-pypackage cookiecutter gh:audreyr/cookiecutter-pypackage cookiecutter https://github.com/drivendata/cookiecutter-data-science - https://lab.github.com/githubtraining/create-a-release-based-workflow (90m)
On Fri, Apr 10, 2020 at 5:52 PM Wes Turner <wes.turner@gmail.com> wrote:
On Fri, Apr 10, 2020 at 4:40 PM kirby urner <kirby.urner@gmail.com> wrote:
Thank you very much for the pull requests Wes! I got notification by email.
They may be against a version that no longer exists, but no matter. We're gonna poke around live on camera, starting in about 30 minutes. We go for 2.25 hours with one or two breaks.
Cool. Good timing
I'm taking my campers right into my mailbox and showing through Github how it all might work, even if I don't actually make it work.
I've got the Daniel Shiffman "Git for Poets" playlist queued up through [the main Notebook]( https://github.com/4dsolutions/python_camp/blob/master/PyCampNextLevel.ipynb ).
Providing opportunities to soak up knowledge about Git and Github has been a primary focus of this camp.
GitHub has resources for learning Git and GitHub: https://try.github.io/ https://lab.github.io/
I can't recommend Learn Git Branching enough: https://learngitbranching.js.org/
My two cohorts so far have differed quite a bit in character.
The first group featured teens eager to dive into deep topics, per the camp blurb, and got antsy when I didn't talk machine learning right away. This might be too much a camp for noobs. I didn't have the Jupyter Notebook four day outline yet. They're nervousness is partly what drove me to get it out there, reassure them our content would match the camp description.
https://jakevdp.github.io/PythonDataScienceHandbook/ https://github.com/jakevdp/PythonDataScienceHandbook - Launch in Binder, Colab links
The second group is younger, considers itself adept and into programming, yet is patiently learning a lot of core Python. One camper had worked with his dad on solving that "1/3 --> float" problem. I incorporated their code verbatim as a part of our shared process.
IMHO, your strategy for finding answers to questions is maybe the most important aspect of learning to code:
- find the docs and bookmark them - find the source and bookmark it - list every possible word for the thing you're describing - try adding "double quotes" around certain terms and error messages - exclude with minus: -"this or that"
### Mailing Lists - Google search with "site:mail.python.org" and/or "inurl:" queries https://www.google.com/search?q=site%3Amail.python.org (inurl doesn't match mm3-migrated lists too) - Google Groups, if the list is set up there too - Gmail "list:python.org" queries - This doesn't find messages that you didn't receive because you weren't subscribed yet. - Gmail "from:list@mail.python.org" queries - This doesn't find messages that you didn't receive because you weren't subscribed yet. - Markmai:l "list:org.python.edu-sig" queries https://markmail.org/search/?q=list%3Aorg.python https://markmail.org/search/?q=list%3Aorg.python.edu-sig
[1] "[Edu-sig] Learning Code IRC for kids?" [2] "REQ: HOWTO mailing lists resources"
I've never shared about the construct manager construct with like middle schoolers before, however that's a big part of the plan for today. I [showcase that construct]( https://github.com/4dsolutions/python_camp/blob/master/ContextManager.ipynb) for connecting to / working with / disconnecting from databases (in our case sqlite3 databases). I tell them they're previewing the high school of tomorrow.
Is this how context managers work?
```python class MyManager: def __enter__(*args, **kwargs): print("entering") print((args, kwargs))
def __exit__(*args, **kwargs): print("exiting")
def hello(*args, **kwargs): print("hello")
with MyManager(1, two="three") as mgr: mgr.hello() ```
https://www.google.com/search?client=firefox-b-1-d&q=site%3Adocs.python.org+context+manager - https://docs.python.org/3/reference/datamodel.html#with-statement-context-ma...
Can't remember whether args go to __init__ to __enter__
The School of Tomorrow is a neighboring repo, and crosslinks (hyperlinks) between that, and this camp, have already appeared.
My recommendation to campers starting from day one is they:
(a) install git locally (b) git clone the camp repo (c) create a Github account (d) fork the camp repo (e) git clone the forked camp repo
Then they should treat the (b) structure as something to keep updating with git pull. Treat my version of the repo as read-only.
So you have two working directories; instead of one working directory with multiple remotes (git remote -v)
In my .gitconfig, I have an `r` alias, so I can just type `git r` and it runs `git remote -v`: https://github.com/westurner/dotfiles/blob/master/etc/.gitconfig
However, they can modify and elaborate on their own version of the forked repo (e), and push changes at will. Harvest ideas from my updates for their own works in progress. Share links to their own repos through Zoom chat.
Do you give feedback with pull requests? AFAIU, GitHub Classroom improves the PR for feedback workflow tremendously.
My schedule is such that I'm expected on more week of piloting this curriculum, then shelving it to work on something more data science oriented, returning to the kid camp scene in early June. I'll be looking for ideas on how a strong data science course should go, assuming beginners but with some Python experience. Obviously we'll be using numpy, matplotlib, sklearn and like that.
https://github.com/trending/jupyter-notebook
My notes w/ links and resources for data science: https://wrdrd.github.io/docs/consulting/data-science#
Kirby
_______________________________________________ Edu-sig mailing list -- edu-sig@python.org To unsubscribe send an email to edu-sig-leave@python.org https://mail.python.org/mailman3/lists/edu-sig.python.org/
participants (3)
-
André Roberge
-
kirby urner
-
Wes Turner