We pass information to a CGI program in the POST method. And post packages give the information in exactly the same way as GET methods but instead of sending it as a text string after using post. In the URL it sends it as a separate message. This message comes into the CGI script in the form of the standard input and output.
For example you can see below code.
# Import modules for CGI handling
import cgi, cgitb
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
first_name = form.getvalue('Test')
last_name = form.getvalue('Demo')
print "Hello - Second CGI Program"
print "Hello %s %s" % (Test, Demo)