As i want to run python script that was called by "action" command in html form ..
my html file(hello.html) is
<form method="get" action="process_form.cgi">
Name: <input type="text" name="name">
<input type="submit" value="Submit">
and python script(process_form.cgi) is
form = cgi.FieldStorage() # instantiate only once!
name = form.getfirst('name', 'empty')
# Avoid script injection escaping the user input
name = cgi.escape(name)
<p>The submitted name was "%s"</p>
All these files are store in var/www/ folder and using http://localhost/hello.html
form in displayed and entering something and submitting it then whole cgi file is displayed (if i use .py extension rather then .cgi then it will just open for downloading)