surface from 3 or 4 lines

hi guys
i am working on a way to create a surface from 3 lines/curves

i used python before
but i don’t know how to use it in blender

i need a script to make my tests going faster
any help

maybe this is the right direction?