process http get requests

I have the following code in my file, but I get the following message

undefined name 'self'

query = urlparse(self.path).query
query_components = dict(qc.split("=") for qc in query.split("&"))
subnet = query_components["subnet"]

I'm trying to process http get parameters. How can I do this?

Could you post all of your code? It's hard to work out what might be the problem from that snippet. I don't see anything defining the variable self, though -- are you sure it's defined?