Embed presentation
Download as PDF, PPTX












































![def parse_header(line):
plist = map(string.strip, string.splitfields(line, ';'))
key = string.lower(plist[0])
del plist[0]
pdict = {}
for p in plist:
i = string.find(p, '=')
if i >= 0:
name = string.lower(string.strip(p[:i]))
value = string.strip(p[i+1:])
if len(value) >= 2 and value[0] == value[-1] == '"':
value = value[1:-1]
pdict[name] = value
return key, pdict
def parse_header(line):
parts = _parseparam(';' + line)
key = parts.__next__()
pdict = {}
for p in parts:
i = p.find('=')
if i >= 0:
name = p[:i].strip().lower()
value = p[i+1:].strip()
if len(value) >= 2 and value[0] == value[-1] == '"':
value = value[1:-1]
value = value.replace('', '').replace('"', '"')
pdict[name] = value
return key, pdict](https://image.slidesharecdn.com/pyconminisapporo2019-190511051408/85/Python-45-320.jpg)




























This document provides an overview of Python development from 2000 to the present (2019). It discusses Python's use for web development and various web frameworks from 2000 to 2010 and now (2019). Sample code is also provided to parse header parameters from a string.












































![def parse_header(line):
plist = map(string.strip, string.splitfields(line, ';'))
key = string.lower(plist[0])
del plist[0]
pdict = {}
for p in plist:
i = string.find(p, '=')
if i >= 0:
name = string.lower(string.strip(p[:i]))
value = string.strip(p[i+1:])
if len(value) >= 2 and value[0] == value[-1] == '"':
value = value[1:-1]
pdict[name] = value
return key, pdict
def parse_header(line):
parts = _parseparam(';' + line)
key = parts.__next__()
pdict = {}
for p in parts:
i = p.find('=')
if i >= 0:
name = p[:i].strip().lower()
value = p[i+1:].strip()
if len(value) >= 2 and value[0] == value[-1] == '"':
value = value[1:-1]
value = value.replace('', '').replace('"', '"')
pdict[name] = value
return key, pdict](https://image.slidesharecdn.com/pyconminisapporo2019-190511051408/85/Python-45-320.jpg)


























