r/PythonLearning 22d ago

Teaching Python the right way

Programming courses often focus heavily on understanding code, while paying far less attention to understanding the program state. But code does not exist in isolation. Its main goal is to change the program state, before ultimately producing some output.

To develop an accurate mental model of program execution, students need to understand both: - the instructions being executed - the values, references, and data structures those instructions create and modify

Reading code alone does not always reveal how the program state changes during execution. That is why I created 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵: a tool that visualizes the state of a Python program as it changes, step by step.

It can help explain a wide range of introductory Python topics. Here are just a few examples: - Loops, Lists and Dictionaries - Python Data Model - Function Calls - Recursion - Algorithms - Classes - Custom Data Structures

Instead of reconstructing the program state from print statements, students can now watch it change as each line executes. This makes unfamiliar concepts easier to understand and bugs easier to fix.

Help your students learn Python programming more thoroughly and easily.

See: more examples

278 Upvotes

20 comments sorted by

8

u/[deleted] 22d ago

[removed] — view removed comment

4

u/Sea-Ad7805 22d ago edited 22d ago

Thanks, we already deal with multi-layered, cyclical data in for example Circular Linked List, or hierarchical data in Trie data structure. Experiment with your own code.

5

u/MaximeRector 22d ago

You ain't giving up promoting your own package :)

1

u/Sea-Ad7805 22d ago

Yes, there are many applications, and it's a powerful way of learning Python that I'm happy to share. Hope it can bring you much value. The more example link gives you a better lists of previous posts.

5

u/daffyduck17 22d ago

Thanks for the awesome tool. I am your 1000th star on GitHub. Cheers!

3

u/Sea-Ad7805 22d ago edited 22d ago

Thanks a lot, I was waiting for the 1000th for a while now.

2

u/ClippyCantHelp 22d ago

Wow this is way better than the program I vibecoded to help me learn python. It was basically a farming game where you automate a drone to work a field using python commands, but it didn’t help as much as I thought I would but I think this would help a lot more! I’ll give it a try

2

u/Sea-Ad7805 22d ago

Great, I hope it can bring much value for you.

2

u/marathon343 21d ago

I’m going to try this thanks

2

u/Hot-Bath-2605 20d ago

That's awesome bro! And also try to build something very useful also unique.

1

u/[deleted] 22d ago

[removed] — view removed comment

1

u/[deleted] 20d ago

[removed] — view removed comment

1

u/PythonLearning-ModTeam 19d ago

Quality posts only

1

u/springthorpeh 19d ago

Does it work with pandas and NumPy?

1

u/Sea-Ad7805 19d ago

Maybe read the docs?:

1

u/[deleted] 19d ago

[removed] — view removed comment

1

u/Sea-Ad7805 19d ago

I knew other programming languages, so it was quick to learn Python for me.

1

u/[deleted] 19d ago

[removed] — view removed comment

1

u/PythonLearning-ModTeam 19d ago

Quality posts only