here is my part of program,you can see main structure,i want to wrap it in class ,<br>class   webdata(object):<br>    def  __init__(self,arg):<br>        jobs = Queue.Queue()<br>        for  x  in  name:<br>            jobs.put(self.url)<br>                <br>    <br>          <br>    def download(self):<br>        while not self.jobs.empty():<br>            url = self.jobs.get()<br>            hx = httplib2.Http()<br>            resp, content = hx.request(url, headers=headers).read()<br>            self.jobs.task_done()<br><br><br>    def  myrun(self):<br>        for i in range(30):<br>              threading.Thread(target=self.download).start()<br>        self.jobs.join()<br>    <br>if  __name__=="__main__":<br><br>    s=webdata('quote')<br>    s.myrun()<br><br>when it run ,the output is  :<br>Traceback (most recent call last):<br>  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner<br>    self.run()<br>  File "/usr/lib/python2.7/threading.py", line 505, in run<br>    self.__target(*self.__args, **self.__kwargs)<br>  File "/home/pengtao/workspace/try.py", line 75, in download<br>    resp, content = hx.request(url, headers=headers).read()<br>  File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1288, in request<br>    (scheme, authority, request_uri, defrag_uri) = urlnorm(uri)<br>  File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 201, in urlnorm<br>    (scheme, authority, path, query, fragment) = parse_uri(uri)<br>  File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 197, in parse_uri<br>    groups = URI.match(uri).groups()<br>TypeError: expected string or buffer<br><br><br>when i use the same  structrue, don't   wrap it ,it can run .<br><br>