Listen to this post or continue reading below. (Audio provided by ElevenLabs.)
It seems like, every few years, I get the urge to play around with Python programming. This time, I found myself looking at some of my old BASIC files from back in the day and knew I needed a better challenge so I started reviewing all the Python training materials I’d gathered in my previous attempts. Jose Portilla’s Complete Python Bootcamp is still an excellent resource on Udemy. It contains 22 hours of clear and understandable video instruction with additional articles and coding exercises that gradually introduce students to the elements of Python.
PyCharm is my environment of choice this time around. It still has a free option and handles Jupyter notebooks pretty well so it does everything I need.
Reviewing the basic file I/O functions, I immediately found a practical use for the language. I encountered some gargantuan text files awhile back that couldn’t be easily opened and I thought about how nice it would be to have a small script that would quickly search the files for specific text and spit out the matching lines.
I tested the script on some old web logs and it worked really well.
As a side note, I wrote this one on my own with just a few Google searches to find the functions I needed. ChatGPT provided the code review and spotted a couple of issues, including suggesting a case-insensitive search.
My next project was to look at how Python scripts could be launched from Access VBA. While VBA can be a fairly powerful and versatile language, Python is naturally more suited to such things as external file processing. The two could actually complement each other as Python does the initial processing of large data files or other jobs and then outputs the processed data for the Access database to link to and work with.
You can see my video on using the VBA Shell command to call Python on YouTube. If you find this video helpful, please remember to give it a Like and you can also subscribe to my channel for notifications of future videos.
I’ve also started a Github repository to hold these scripts and others I’ll be writing in Python and I’ll be posting updates here on the site of future projects.
Sign up for my newsletter to receive updates about new projects, including the new book "Self-Guided SQL"!
We respect your privacy and will never share your information with third-parties. See our privacy policy for more information.
