TypeError: 'int' object is not callable
时间:2011-01-30
来源:互联网
- #coding: utf-8
- import threading
-
- class Test(threading.Thread):
- def __init__(self, dfile, start, end):
- threading.Thread.__init__(self)
- self.dfile= dfile
- self.start = start
- self.end = end
-
- def run(self):
- global mutex
- mutex.acquire()
- self.dfile.seek(self.start, 0)
- content = self.dfile.read(self.end-self.start+1)
- print 30*'+'
- print content
- print 30*'+'
- mutex.release()
-
- if __name__ =="__main__":
- file = open("123.html", "r")
- threads = []
- mutex = threading.Lock()
- for x in range(5):
- threads.append(Test(file, x*100, x*100+100))
-
- for t in threads:
- t.start()
-
- for t in threads:
- t.join()
作者: butterinsect 发布时间: 2011-01-30
第8行 self.start = start
传入的 start 是 int
然后你就调用了t.start()
传入的 start 是 int
然后你就调用了t.start()
作者: STLT1 发布时间: 2011-01-30
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28