Reading and writing an unknown character into an appropriately named file
This is only partly an answer, intended more as a thought exercise about what you might do. I provide a couple examples that you might want to pick and choose parts of, but you probably will not want to just grab the whole. So let's dive in.

What would benefit from this being more general? This seems like a fairly small and specific task. I could imagine parameterizing the input, the list of tags, the mapping from tag name to file name, or the handling once a matched tag is found. Let's examine doing all at once:

import urlparse
def parse_queries(input, get_filename, handle, tags={'blog', 'p', ...}):
    for line in input:
        qsl = urlparse.parse_qsl(urlparse.urlparse(line).query)
        if not qsl:
            print repr(line), "does not yield query"
            continue
        for key, value in qsl:
            if key in tags:
                handle(get_filename(tag), value)
            else:
                print key, "not in tags."

def dot_text(tag):
    return tag + '_file.txt'

def append_to_file(filename, value):
    with open(filename, 'a') as output_file:
        output_file.write(value)

with open("filename") as input:
    parse_queries(input, get_filename=dot_text, handle=append_to_file)


Do any of these help more than they harm readability? Does extracting the small methods like dot_text and append_to_file offer useful chunks of reusable code? I'm not sure myself. It certainly makes the call harder, but providing defaults is easy enough. Thinking it through should raise other questions, such as whether get_filename should be part of parse_queries, or part of handler.

Perhaps it's the line processing which could be parameterized:

def parse_file(input_file, parse):
    ...
    for line in input:
        for key, value in parse(line):
            if key in tags:
                ...

def extract_query_params(line):
    qsl = urlparse.parse_qsl(urlparse.urlparse(line).query)
    if not qsl:
        print repr(line), "does not yield query"
    return parsed_url

parse_file("filename", extract_query_params)


But again ask whether this helps generality more than it harms readability. I'd address other small issues first:


comparing a list to 0 (parsed_url &gt; 0) doesn't have much meaning.
output_file.write(value) seems unlikely to insert newlines, so your values will blur together.
the name tags has a lot of implied meaning in an HTML context, so your use here in an HTTP context could be confusing.
indentation, at least here, your with statement is at the same level as its contained for loop.
unit tests; how better to verify whether this does what you want? Of course if you do want to test this, you may find that parameterizing things makes this measurably easier. Or maybe you really need to look at the resulting files.