6 ms·
Ask HN: Interesting 2-3h coding projects in Python?
I recently switched jobs to become a full-time Python teacher. I am going to teach a 60h course next month so I am looking for interesting projects related to algorithmics, basic data processing, OOP, etc. My course is split into 3h sessions so I need rather small projects (2-3h).
Any suggestions?
- r_sz 3y agoRPN calculator? If it's too short project, you can extend it with some extra functions.
- is_true 3y agoMaybe a data store? Persist data -> search it -> too much data, need an index -> search on that index -> keep that index updated I think you can split that in couple of parts to teach it in a few sessions and then join everything in one project, which when I started with Python it was hard for me to understand.
- fdeage 3y agoLike a small DB engine, or something like redis maybe? Interesting, definitely too large for a single 3h session, but if splitted that would make a cool project.
- oftenwrong 3y agoMake-like build system. This would expose students to a few useful concepts, and can be a 'jumping-off point' into various more advanced concepts. - topological sorting the build graph - what is a graph - running child processes - what a process is - process api - interaction with the filesystem - r/w files - mtime comparisons - how computers store time - what is incremental execution I would suggest to skip parsing, and use a Python literal to hold the 'Makefile'-equivalent dependency graph data structure. You let students come up with their own fun build graphs, like making sushi: tuna_maki -> nori, cooked_rice, tuna_fillet, chef, sushi_roller cooked_rice -> uncooked_rice, rice_cooker, water, rice_seasoning tuna_fillet -> tuna_slab, knife tuna_slab -> fishmonger, money nori -> algae, dehydrator And then, when executed, it would print the steps, or say that a target was already made.
- fdeage 3y agoVery interesting per se, but needs to introduce several concepts (graphs, process management, etc.) that are too low-level for my scope :)
- croo 3y agoAdvent of code is always fun.
- ogou 3y agoPygame is a good library to generate multimedia. I'm sure you could come up with some exercises with it. Also, convert data in a PDF to a CSV file. I have needed to do that many times over the years and learned a lot of Python by improving my approaches.
- jordiburgos 3y agoJust found this in HN before: https://app.codecrafters.io/catalog https://app.codecrafters.io/catalog You can get any of those projects and chop it down to fill the time you need.
- fdeage 3y agoVery nice, even though these are quite ambitious projects!
- jventura 3y agoDepending on the level of your students, if you get the chance to talk a little bit about sockets, you can always guide them to build a very simple HTTP Server. In reality, you don't need to go much deep on sockets, just talk about send() and recv(), and in very simplistic terms. You can check this [1] blog post of mine, and the final code is very simple but very useful to learn how the "internet" works.. Good luck! [1] https://joaoventura.net/blog/2017/python-webserver/ https://joaoventura.net/blog/2017/python-webserver/
- fdeage 3y agoThank you for that, networking is often the blind spot when teaching Python... Also, you're right, it looks much simpler than expected. I'll have a look!
- schwartzworld 3y agoGames are always a good way to learn, imo. I make a lot of little games for my kids and try out programming techniques along the way.
- gwnywg 3y agoTry building bots in codingame.com, 2 hours should be enough to build something that works :)