【发布时间】:2011-08-02 05:05:05
【问题描述】:
if data.find('!search') != -1:
nick = data.split('!')[ 0 ].replace(':','')
conn = httplib.HTTPConnection("www.md5.rednoize.com")
conn.request("GET", "?q=" + arg)
response = conn.getresponse()
data = response.read()
result = re.findall('<div id="result" >(.+?)</div', data)
if result:
sck.send('PRIVMSG ' + chan + result + '\r\n')
else:
sck.send('PRIVMSG ' + chan + " :" ' could not find the hash' + '\r\n')
当我运行这段代码时,我得到了这个错误:
conn.request("GET " + "?q=" + arg)
TypeError: cannot concatenate 'str' and 'list' objects
我该如何解决这个问题?
【问题讨论】:
标签: python sockets irc typeerror