Python code against web form

how to write python code against web form?
Please guide

I think this should help:

thanks for the help.