[cse491] homework5
C. Titus Brown
ctb at msu.edu
Wed Oct 1 07:56:05 PDT 2008
On Wed, Oct 01, 2008 at 05:59:43AM -0400, Kareem Janoudi wrote:
-> header_line.split(': ') works, but if you dont want to loop through lines, i
-> found this to be pretty simple:
->
-> headers = re.compile('(.*?)\:(.*)').findall(data)
->
-> which will return a list of tuples of headers, where data is the full data
-> you receive from doing a .recv
"""
Some people, when confronted with a problem, think "I know, I'll use
regular expressions." Now they have two problems.
"""
See
http://www.codinghorror.com/blog/archives/001016.html
for links to a long-winded discussion of the above quote :)
--titus
More information about the cse491-fall-2008
mailing list