python syntax in read line file
<p>I starting learn python ,but i meet a SyntaxError. when i build filter to get recent record in log file.
log file like this</p>

<pre><code>  Sat Jun  2 03:32:13 2012 [pid 12461] CONNECT: Client "66.249.68.236"
  Sat Jun  2 03:32:13 2012 [pid 12460] [ftp] OK LOGIN: Client "66.249.68.236", anon     password "gxxglxxxxt@google.com"
  Sat Jun  2 03:32:14 2012 [pid 12462] [ftp] OK DOWNLOAD: Client "66.249.68.236",   "/pub/10.5524/100001_101000/100022/readme.txt", 451 bytes, 1.39Kbyte/sec


import time
lines=[]
f= open("/opt/CLiMB/Storage1/log/vsftp.log")
line = f.readline()
lines=[line for line in f]
def OnlyRecent(line):
    return time.strptime(line.split("[")[0].strip(),"%a %b %d %H:%M:%S %Y" &lt;(time.time()-(60*60*24*5)))
print ("\n".join(filter(OnlyRecent,lines)))
f.close()
</code></pre>

<p>error when run it</p>

<pre><code> Traceback (most recent call last):
 File "ex2.py", line 8, in ?
 print("\n".join(filter(OnlyRecent,lines)))
 File "ex2.py", line 7, in OnlyRecent
 return time.strptime(line.split("[")[0].strip(),"%a %b %d %H:%M:%S %Y" &lt;(time.time()-(60*60*24*5)))
 File "/usr/lib64/python2.4/_strptime.py", line 287, in strptime
 format_regex = time_re.compile(format)
 File "/usr/lib64/python2.4/_strptime.py", line 264, in compile
 return re_compile(self.pattern(format), IGNORECASE)
 File "/usr/lib64/python2.4/_strptime.py", line 251, in pattern
 format = regex_chars.sub(r"\\\1", format)
 TypeError: expected string or buffer
</code></pre>

<p>How to solve it. Thanks!</p>
