1

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!

3
  • What do you mean send GET variables to HTML? Get variables can be set in url, after "?" character and divided by "&" character: <a href="/somewhere/?var1=value1&var2=value2>. When user clicks on that link server will get two GET variables. Commented Jan 7, 2012 at 11:19
  • possible duplicate of Is there a better way to write this URL Manipulation in Python? Commented Jan 7, 2012 at 11:28
  • @Quentin - that looks pretty complicated...I was looking for a simple solution that I overlooked. thanks though Commented Jan 7, 2012 at 11:43

1 Answer 1

3

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
Sign up to request clarification or add additional context in comments.

1 Comment

Ok, I added an example with python's urllib. I think this should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.