I have web page below. Much of it is not listed.
This web page has a form section, and this form section has an image button named login-logout with a method=post

How do I write a python code that will act as if a user has clicked this button name login-logout. When this button is clicked the web page will automatically submit a value of 1 to the web server ?

time_difference = time.mktime(time.localtime(time.time())) - float(cookie_time_stamp);
if (time_difference > 10):
#the code will click on the login-logout button
<td align=right><form method=post action=/index2.py><br><font class=bigwhite>User: </font><font class=bigorange>admin</font> &nbsp;&nbsp;&nbsp; <font class=bigwhite>Hostname: </font><font class=bigorange>iserver_1&nbsp;&nbsp;</font><br><br><input type=image src="images/button-logout.gif" name="login-logout" value=1>&nbsp;</form></td>