python出错
import threading,timedef run(n):
print("hello,world",n)
time.sleep(1)
start_time = time.time
t1 = threading.Thread(target=run,args=("1",))
t2 = threading.Thread(target=run,args=("2",))
t1.start()
t2.start()
t1.join()
t2.join()
print(time.time()-start_time)
i = input(">")
报错是:
Traceback (most recent call last):
File "I:\lomen cmd import\temp\1.py", line 14, in <module>
print(time.time()-start_time)
TypeError: unsupported operand type(s) for -: 'float' and 'builtin_function_or_method'
第6行加个括号time.time() qq1151985918 发表于 2022-7-11 17:37
第6行加个括号time.time()
ok,谢谢
页:
[1]