Show that we can do python versions of cgi

import os
print('Content-Type: text/html\n\n<h1>Search query/h1>')
query_string = os.environ['QUERY_STRING']
SearchParams = [i.split('=') for i in query_string.split('&')] #parse query string
# SearchParams is an array of type [['key','value'],['key','value']]
# for example 'k1=val1&data=test' will transform to 
#[['k1','val1'],['data','test']]
for key, value in SearchParams:
    print('<b>' + key + '</b>: ' + value + '<br>\n')

From: https://stackoverflow.com/questions/16566069/url-decode-utf-8-in-python

is this parser:

def url_parse(url):
    l = len(url)
    data = bytearray()
    i = 0
    while i < l:
        if url[i] != '%':
            d = ord(url[i])
            i += 1
        
        else:
            d = int(url[i+1:i+3], 16)
            i += 3
        
        data.append(d)
    
    return data.decode('utf8')
