Using ChatGPT to Automate Python Programming on a Raspberry Pi

preview_player
Показать описание
I truly am not very good at Python or programming in general, but I have had almost instant success when I asked OpenAI's Large Language Model, ChatGPT, to help me with a problem I was procrastinating on because I was not sure how to handle it yet. This video briefly flies through the workflow I used to generate and test the code with OpenAI's ChatGPT and then run it on a Raspberry Pi.

Before requesting the model to do some work for my project, I asked it to provide me (in detail) a list of its top ten limitations and benefits as well as a few more test questions. Then, I formed my prompt to conform to the way the model answered my test questions.

I asked the model: "Write a Python script that will take as input four integer arrays of length 11, xmin_array, ymin_array, xmax_array, and ymax_array. It will delete the entries in the arrays corresponding to the regions with overlap of 50% or more and return new arrays."

I further changed my original prompt text from the word "delete" to "merge" in order to achieve the effect I was looking for. I then tested the resulting code, which went pretty much flawlessly as shown in this video. The only thing I later hand-coded in the LMM's output code was the overlap parameter (reduced from 50% to 20%) in order to achieve a result I was satisfied with.

Then, I moved on to work another part of the project.
Рекомендации по теме
visit shbcf.ru