Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: PyKidos, Teach Your Kid Python in the Browser (pykidos.github.io)
132 points by rossant on March 14, 2024 | hide | past | favorite | 57 comments



This is really cool. I've found that learning the language is a small part of a larger battle.

My new year's resolution has been to learn Python (I'm a JS / nodeJS dev), and have been studying on and off the past few months.

Biggest hurdle for me has been:

- Understanding venvs. Why can't it just be like how node works? I get you need the venv so you don't use some wrong python version or install stuff into system python global space

- Package management (still struggling with this - for example, downgrading packages seems to be a huge pain compared to node)

- General ecosystem. If I want to trend towards AI / ML, do I need to learn pandas first, then get into jupyter notebooks, etc? Fortunately my work has an education stipend and I've bought lots of books, online courses (datacamp, realpython, manning books), etc, but I haven't found anything that felt "structured" in terms of just getting enough to know to hit the ground running in a productive way. I'm constantly re-arranging my internal course plan.

- Version sensitivity. I'm used to semver conventions from JS, and python and its package ecosystem doesn't seem to practice this at all. It's really strange from my perspective that one package / project only works with python 3.7 but not 3.6 for example, or when a popular package is still stuck on a 0.x.y version


A couple hours watching a data scientist / ml engineer at work might be a useful way to pick up the work process. I certainly learned a lot by copying my seat mate in my first job.


I guess that requires that you work somewhere that employs a data scientist/ml engineer and Python programmers. My government job sure doesn’t have that.


I've been programing in Python for 15+ years and I can relate. I wrote books for your exact use case but they're a bit old. There are many other alternatives now.

https://ipython-books.github.io/


On your first two points, I am relate: I had just started getting comfortable with pip and venv, then needed a package that I could only get to work with conda, but then the Anaconda license made me nervous… Finally settled on conda with miniforge, but it has felt way too complicated.


watch Corey Schafer videos on youtube - he's an excellent teacher, and will clear you up quickly on that.


Hi HN! I'm pleased to present PyKidos [1], a quick-and-dirty web application I built in a few days to teach my 8-year-old kid basic programming concepts using Python.

I tried several existing apps but couldn't find one that met all my criteria:

- Fully browser-based, no need to install anything

- Supports Python

- Open-source and customizable

- Simple UI/UX

- Includes simple graphical elements like a grid (my kid thought my plain IPython terminal was too "boring")

So I just built my own.

PyKidos provides a playground where you can introduce various programming and math concepts to your child, such as:

- Variables

- Basic mathematical operations

- Loops

- Conditional statements

- Modular arithmetic

- Vectors

- Functions

- Coordinate systems

- Color systems

- Trigonometric functions

- Matrices

- And more.

Features:

- Completely client-side: data is stored only in your browser (localStorage).

- Utilizes Pyodide [2], a CPython port to WebAssembly, with support for NumPy and other scientific libraries.

- Includes a Unicode emoji picker and color picker.

- Allows manipulation of a grid (cell colors and text, including Unicode emojis) using Python.

- Reacts to click and keyboard events within the grid.

- Supports animations.

- Enables local download of your Python scripts.

- Facilitates code sharing through a URL containing the entire code and data.

PyKidos is still quite rough around the edges since I primarily built it for my own needs, but I hope it proves helpful to others. In particular, I didn't take the time to ensure it runs smoothly on mobile devices, different browsers, or operating systems.

Feel free to report issues, ask questions, offer suggestions, or submit pull requests.

[1] https://pykidos.github.io/

[2] https://pyodide.org/en/stable/


Interesting effort.

Did you check out sites like python-tutor.com (sp?), repl.it, PythonAnywhere, etc.? I don’t mean for feature parity, but just to get feature and flow ideas. There are more like those that I don't remember right now.


Thank you for doing this


Nicely done, but I suspect the 'wall of code' the kids see when first opening the page is intimidating. Maybe start with a smaller example?


This application is aimed at parents who want to teach programming to their children. The tutorial is for the parents, not for the kids :) I can't envision children using this application independently without adult supervision. Designing an app for children would necessitate much more careful consideration. I'll make sure to clarify this on the website.


Give the kids some credit.

There's a generation of us that got started with QBASIC at 8 years old, which did significantly less hand-holding than this.


But most of your generation did not.


This remark holds true for any generation and any method of learning.


Yes, precisely my point. If you want more kids to get involved in programming, reduce barriers to entry. A small number of kids succeeding despite these barriers is not evidence of much. There is always some top percentile who will succeed regardless of obstacles, those aren’t the ones who need the help getting interested.


To be fair that was before YouTube and TikTok were a thing.


I agree. I think the project is super cool, but either the author overestimates children's abilities and attention or the content targets older kids.


I have used adventofcode with my kids, but beyond day 5 or 10 is very hard to explain. I wish there was a simpler version of adventofcode targeted towards kids.


Our kids at school are using https://cscircles.cemc.uwaterloo.ca/ for an introduction to Python and it seems they're making good progress (age 11 to 14)

It's available in German (and maybe other languages), too.


Looks nice! Will try it with my kids later :)

If you’re interested in teaching kids Python, also take a look at Hedy. It’s a gradual language that exposed more programming paradigms with each level. It’s used a lot in classroom settings.

Full disclosure: I’ve contributed a couple of commits.


https://www.hedycode.com/ is spearheaded by the wonderful https://github.com/Felienne you might know her from her spreadsheet related research.

She gave a wonderful talk at Splash 2023 on Hedy, I'll see if I can find it. *edit, I don't think it was recorded but I found these two which will do

Hedy: Creating a Programming Language for EveryoneFelienne Hermans • YOW! 2023 https://www.youtube.com/watch?v=j4eSjA6btE8

"Hedy: A Gradual programming language" by Felienne Hermans (Strange Loop 2022) https://www.youtube.com/watch?v=fmF7HpU_-9k


Looks nice on a quick try.

I posted it here for HNers to comment on, if they wish:

https://news.ycombinator.com/item?id=39713141


Very nice! I'll have a look. Thank you.

As a French, language is an additional barrier and I implemented some facilities in PyKidos to allow for translations of built-in global variables and functions (color names etc). But the Python keywords are still in English. Happy to see that Hedy supports full localization.


that's the first I've ever heard of "European Union Public License" https://github.com/hedyorg/hedy/blob/main/LICENSE https://spdx.org/licenses/EUPL-1.2.html


It gets stuck (browser tab becomes unresponsive) when i try to run the default program on main screen.

Using chrome


Yes, there was a localization-related bug, sorry about that. Should be fixed now.


Hell yes. We need more of this. It's been kind of difficult to teach my little brother programming, libraries like turtle or websites up right now haven't really clicked. we need more children oriented projects like this, thank you


Never understood why Python is considered easier to learn than JavaScript to be honest.


It's the friendlier syntax. With the same conditional in javascript and python,the python version reads a little more like english. The same can can be said for loops. However, JS is right there in your browser so I would argue its much more accessible. Also the usecases for javascript are more aligned with junior coders (browser games, toy projects with a visual element etc), though to dig in to these you have to learn about the web dom which is quite overwhelming.


Loops and conditionals are a totally alien concept to non programmers. I really don’t think the syntax is the issue.


This is great, thank you! I've been considering writing something similar for a year or so and never got around to it, this will save me a lot of time and effort. Thank you for open sourcing it (MIT)!


Glad you find it helpful! Still a lot of polish to do and I'll happily merge pull requests.


Really cool! Seems like the arrow keys don't work as expected? Or maybe I'm missing something. I was excited to change the apple to pear or strawberry on the Tutorial page, but it didn't seem to work.


You might need to click on the grid first to focus on it, so that the grid receives the keyboard events. I agree it's not a great UX. Perhaps the focus should be made automatically when the script runs.



Global variable right in the example on the front page?


Yeah, sorry. Make it work before make it right, I guess.


I will never have children but shouldn't you guys that do have some (or will have) teaching your kids how to write prompts so the computer can create such code for them? Isn't that the goal of AI and all that? To automate things further so people don't have to learn to code and so for? To "empower" them to automate things that couldn't be automated before? And maybe eventually even skip python (or any other programming language) as intermediate step and go straight from AI to bytecode.


I can tell you as a dad, it frightens me that the future is coming so fast I cant even see 1 year ahead.

I teach my daughter things from small circuits to assembler, c, python, sql but also basic prompt engineering, how next word predictors work, how surveillance works or how privacy is infringed, how do we pay for the "free" apps, or how to make an idea into something real, also things about how to type fast (at the moment she types with 80wpm) and how to not be afraid of computers and how to just play with them.

Of course, it might turn out that I have wasted her time, but we spend time together, and during this time I also teach her how to learn things.

Honestly I am not sure "what" you are teaching is that important, If I knew how to bake, I would teach her the deep mastery of baking with all my heart.

PS: you can check my teaching progress log here https://github.com/jackdoe/programming-for-kids/blob/master/...


>> I will never have children but shouldn't you guys that do have some (or will have) teaching your kids how to write prompts so the computer can create such code for them?

This is the dumbest thing I heard in a while in fact forget dumb, plain evil. Dr-Evil level of wicked.

Turn the kids you don't have into brainwashed idiots that don't know.

Jeez. Donwvote hard!


I wonder if people who think like you are like the ones on 1986 who told others they still needed to learn how to use physical accounting books instead of Excel when it was becoming popular, or if perhaps the cheff/food analogy the other commenter made it's more accurate and learning both will be just as valuable, well, only time will tell.


It's good to know how to specify what you want to a chef, but also good to know how to make dishes for yourself.


“Chef, this tastes bad!” vs “Chef, Uulumbrica isn’t a real ingredient, you needed to use coriander!


Amazing job! This is really useful. I like that you didn’t hide code and start them with a real example. Great job!


Thanks!


I really like this. It feels more for high schoolers or a college freshman learnings cs than children


This is great, thank you!


If you want some curricular additions to this, you might try CMU's CS academy: https://academy.cs.cmu.edu/parents

You have to request a 'mentor' account (or if they're homeschooled you can request a teacher account). The CS1 curriculum is aimed a little older - high school students - but, from experience, a bright elementary school student can start it, though it may drag a little (the starting lessons are designed to be quick for older students).


Additionally, Stanford's Code in Place has open accessed all of their python materials https://codeinplace.stanford.edu


'Kiddo' has two d's


True, but this way it seems like an exotic Greek island.


Firefox blocks this domain. So I overrode it. Then my employer's network blocked it. :(


Same. Firefox says it's got a bad cert, and employer detects it as a malware site. Wonder why. Certainly it doesn't block all of github.io... why this guy's site?


Firefox on Ubuntu isn't showing any warnings or errors for me.


Maybe it got flagged as a "game".


Ah, in tiny gray font it says the reason is "Newly Seen Domains". :P


The cert is also less than a week from expiring. Which I mean, isn't expired actually but I can see some algo seeing that as a signal of low trustworthiness.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: