'I want to call child bash script while executing python script through CGI

This is what I have tried but no luck. I have defined cmd variable to hold executable part of bash. then called os.system to execute it but no luck.

#!/usr/bin/python
import cgi, cgitb, os, subprocess
form = cgi.FieldStorage()
first_name = form.getvalue('first_name')
last_name  = form.getvalue('last_name')
middle_name = form.getvalue('middle_name')
print "Content-type: text/html"
print ""
print "<html>"
print "<head>"
print "<title>Hello - Second CGI Program</title>"
print "</head>"
print "<body>"
print "<h2>Hello %s %s </h2>" 
cmd='sh test_script1.sh '+first_name+' '+last_name+' '+middle_name  #This is where I am defining bash script with parameters to execute
os.system(cmd)
print "</body>"
print "</html>"


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source