You have several options to change the input values and submit a form:
Note that Selenium
and Ghost.py
use a real browser. Mechanize
is the easiest way to go in your case, just note that it may not work for you if there is a lot of javascript involved in the form initializing or submitting process.