mrmo123
mrmo123

Reputation: 725

how to output an HTML GET variable in python

there's lots of information on retrieving GET variables from a python script. Unfortunately I can't figure out how to send GET variables from a python script to an HTML page. So I'm just wondering if there's a simple way to do this.

I'm using Google App Engine webapp to develop my site. Thanks for your support!

Upvotes: 1

Views: 978

Answers (1)

evotopid
evotopid

Reputation: 5429

Just append the get parameters to the url: request.html?param1=value1&param2=value2.
Now you could just create your string with some python variables which would hold the param names and values.

Edit: better use python's url lib:

import urllib
params = urllib.urlencode({'param1': 'value1', 'param2': 'value2', 'value3': 'param3'})
url = "example.com?%s" % params

Upvotes: 3

Related Questions