Finding external contours

I’m looking at this post from the old forum and having the same problem. How do I draw external contour?
Can anyone explain what the answer is doing equivalently with python?

do you see that it’s all about the flag CV_RETR_EXTERNAL?

I did use cv_retr_external but it’s not giving me the correct contour/outline of the object. i wonder if i need to filter contours based on hierarchy using a loop where the answer to that post seems to have done similar thing, but I don’t understand its syntax or data structure like what’s dst and what does vector do.

a picture and code to run on it would be helpful for this discussion