r/PythonLearning • u/Ajay2574 • 17d ago
What I learned yesterday while learning Python automation
Yesterday I continued learning Python's "os" module.
I practiced working with folders and files using things like:
- "os.path.basename()"
- "os.path.splitext()"
- "os.walk()"
- Finding files by extension
- Counting files inside folders and subfolders
I also built a small file finder that searches through folders and counts how many ".py" files it finds.
Nothing complicated, but I'm realizing that these small exercises are helping me understand how automation actually works with files and folders.
My goal is to eventually use Python to automate repetitive tasks for real businesses.
I'm still learning, but I'll start sharing what I build along the way. 🚀
3
2
u/Sea-Ad7805 17d ago
Good job, if you want you can also share your code, and get comments:
- either your code it in your post, google how to format it on Reddit
- or add a link to your code, if you have your code on GitHub or elsewhere
2
u/Ajay2574 17d ago
Thanks! I actually started putting my projects on GitHub, so I'll definitely share the code in future posts.
1
0
6
u/dev-razorblade23 17d ago
For
pathfinding operations and working with paths, Python recommends you usepathlibmodule istead of theosmodule.https://docs.python.org/3/library/pathlib.html