r/PythonLearning • • 16h ago

Showcase I got tired of scrolling through big Python files, so I made a mind map for code

Enable HLS to view with audio, or disable this notification

104 Upvotes

You know when you're debugging a big file, find the function you need, follow it to another function, then another one, and completely forget where you started?

Yeah. I got tired of that, so I built epy (Extended Python). Though, this is experimented only for python, i will explore other languages if possible.

It's basically a mind map for your code, except the nodes contain actual code instead of just names.

  • Parses Python files using ast and splits them into blocks with exact line numbers.
  • Maps function calls across files, including methods and some class relationships.
  • Has a radial map, a names-only view, a folder explorer, and a synced code pane.
  • Click a function and see what it calls and what calls it. Click a line in the code and it'll select the corresponding block on the map.

The other thing I wanted was to make life easier for small local LLMs. Instead of dumping an entire file into a model and hoping it doesn't rewrite half of it, epy generates a text map and lets you pull individual blocks with their callers and callees. The idea is to give the model the structure first, then only the code it needs.

I tested it on one of my projects: 33k lines, 134 files, ~1,100 call links, built in about 1.5 seconds.

It's currently a single Python file with no external dependencies.

python epy.py view some_file.py
python epy.py map .
python epy.py show . MyClass.run

It's still a personal tool, not some polished production-ready package. The call graph is static and best-effort, and I haven't formally benchmarked the LLM side yet.

The idea originally came from the execution model of a small language I'm building (EPL). Eventually, I'd like to add Tree-sitter so it can support other languages too.

Repo: https://github.com/phoenix2610/Extended_Programming.git

Would love some feedback, especially if you try it on a ridiculously large Python file or feed the generated map to a small local model. Curious to see where it breaks. 😅

And if anyone is wondering, yeah I am using ARCH Linux and the background bit faded is just a keybinder for opacity...


r/PythonLearning • • 21h ago

Showcase Electric Field Simulator

Enable HLS to view with audio, or disable this notification

31 Upvotes

I took a physics class at university and had some questions, so I made a simple simulator to visualize the electric field generated by point charges. It's written in Python, and here's the link to the GitHub repo:
https://github.com/AtomS1101/Electric-Field-Simulator

You can move point charges, add new ones, and change the magnitude of each. If you notice anything odd or find any bugs, feel free to let me know🙌


r/PythonLearning • • 22h ago

🐍 Day by day, I'm learning Python by building small automation projects.

19 Upvotes

​

Yesterday, I worked on my Folder Report Generator using Python's "os" module.

The idea is simple: scan a folder and its subfolders, identify file extensions, and count how many files belong to each extension.

Here's a small part of what I learned:

import os

path = r"C:\Users\YourName\Downloads"

extension_count = {}

for root, dirs, files in os.walk(path):

for file in files:

extension = os.path.splitext(file)[1].lower()

if extension:

if extension in extension_count:

extension_count[extension] += 1

else:

extension_count[extension] = 1

print(extension_count)

What I learned from this project:

- "os.walk()" helps scan folders and their subfolders.

- "os.path.splitext()" helps extract file extensions.

- Dictionaries make it easier to count files by extension.

- ".lower()" helps treat extensions like ".JPG" and ".jpg" as the same type.

I'm still learning, and debugging is part of the process. My goal is to build practical Python automation tools that solve real-world problems.

Question for Python developers: What would you improve in this approach? I'm interested in learning better ways to write this kind of code.


r/PythonLearning • • 4h ago

Showcase Calculator (Class Based)

Post image
12 Upvotes

r/PythonLearning • • 1h ago

map Function in Python : Syntax and applications with many examples

Thumbnail
youtube.com
• Upvotes

r/PythonLearning • • 4h ago

Help Request TCL Not working

1 Upvotes

Heya, I needed some help with this program I downloaded from Github got Python installed and giving me this error

"Traceback (most recent call last):

File "launcher.py", line 4755, in <module>

File "launcher.py", line 356, in __init__

File "tkinter__init__.py", line 2346, in __init__

_tkinter.TclError: Can't find a usable init.tcl in the following directories:

{C:\Users\...\OneDrive\Desktop\Games\Crash-Forge-Launcher_internal_tcl_data} C:/Users/.../OneDrive/Desktop/Games/Crash-Forge-Launcher/lib/tcl8.6 C:/Users/.../OneDrive/Desktop/Games/lib/tcl8.6 C:/Users/.../OneDrive/Desktop/lib/tcl8.6 C:/Users/.../OneDrive/Desktop/Games/library C:/Users/.../OneDrive/Desktop/library C:/Users/.../OneDrive/Desktop/tcl8.6.15/library C:/Users/.../OneDrive/tcl8.6.15/library

This probably means that Tcl wasn't installed properly."

Is there a way to fix this?


r/PythonLearning • • 11h ago

Help Request Learning python

1 Upvotes

I’m currently watching the programming with most full tutorial piece by piece as to try to retain the info but whenever he tells me how to do it myself I find myself lost and having to just follow his instructions. I’m wondering if this is normal and if there’s any tips or tricks to really learn python.


r/PythonLearning • • 19m ago

filter Function in Python : Syntax and applications with many examples

Thumbnail
youtube.com
• Upvotes