When faced with a Python script how can you go about learning how it works / debugging issues? In this article I provide insight into my own flow which might help you wrangle that snake. This is a follow-up to my Golang debugging flow https://www.petermcconnell.com/posts/golang_debugging/
Since Python 3.12, the interpreter can run in a special mode that allows Python functions to appear in the output of the perf profiler. When this mode is enabled, the interpreter will interpose a small piece of code compiled on the fly before the execution of every Python function and it will teach perf the relationship between this piece of code and the associated Python function using perf map files. We’ll create a dummy application and use the new tools to solve a perf issue.
Creating an automated database testing tool with ChatGPT Last night I thought I’d try to get ChatGPT to make an automated database testing tool and the results were quite promising.
In conclusion, with guidance, it was able to build a project from scratch that ran a python script and postgres database. It generated some random schema and values for the randomly generated tables. It provided a Python script which would introspect the database and execute queries against it.