Making Menus in Py?

Useful post, I was looking for just this information. Do you know if you can give the entry a python command instead of the command string? It would be good to be able to directly trigger a python method rather than have to execute a string.