Dealing with error codes – debugging
As I said, you’ll seldom get a perfect bit of code. Chapter 2 had some, but those examples were really simple, just to get us started with the “Hello world” level code and get some rubber on the road.
So, you’ll have to either figure them out yourself by understanding all that is there, go to some forum, such as Stack Overflow, ask a skilled friend/colleague, or ask an AI such as Gemini or GPT-4 families.
Let’s debug some code from Chapter 2. Prompts 1-3 were fine, but Prompt 4 needed work.
Prompt 4 debugging
Prompt 4: A script where to ask you to load bench then it will help you browse for the image finally
displayed image.
Again, I said bench
, so that didn’t make sense, but Gemini correctly interpreted what I wanted.
However, the code is not fully functional.
Important note
Don’t run this exact code as it doesn’t work; keep reading.
Please forgive me, I&...