Distributing objects on a surface

Hello.
I need to create a script to distribute an object by a selected surface, in order, first select a surface and then the object you want to distribute, and execute the distribution of the object across the surface.
Thanks.

Isn’t that what dupliverts already does?

You do not even need a script, it is built into the system.

I did not know that the system has a tool to do that, could you tell me how can I do?
Thanks.

or can use dupliface
and before in 2.5 you can randomize the faces then apply the dupliface!

have fun

thanks for your help
I keep trying to reach my purpose