Auto grid & drawing polygon for survey mission in python

I am working in drone programming by python. I am using dronekit and mavlink commands. I want to draw a polygon using python is it possible ? I mean I want to give 4 coordinates as an input then apply the polygon command to draw the path for survey. How can I do in in python. or what are the other alternatives ?

Yes, it is dooable in python. You can use dronekit python, pymavlink or mavros.

please can you give me the code or anything I can use ?

There are a lot of examples. Just search for it. Our copters do not do fancy polygon shapes, I have no code I can give you.

I searched a lot and did not find one. can you send me on example please

This was my first google hit: