imledger 发表于 2019-1-25 21:36:50

为啥总是“ 'module' object is not callable ”

#watching stock real price every min
import threading
import datetime
t=threading.Thread(target=Stock.start_run,args=())
t.start()
start_dt=datetime(datetime.datetime.today().year,datetime.datetime.today().month,
                  datetime.datetime.today().day,hour=9,minute=30,second=0)
stop_dt=datetime(datetime.today().year,datetime.today().month,
               datetime.datetime.today().day,hour=15,minute=30,second=0)


TypeError: 'module' object is not callable

Charles未晞 发表于 2019-1-26 15:04:23

datetime.datetime

Krant5 发表于 2019-1-26 16:36:48

要使用datetime.方法 把

imledger 发表于 2019-1-26 17:04:54

Charles未晞 发表于 2019-1-26 15:04
datetime.datetime

如果去掉一个datetime,则会出现module 'datetime' has no attribute 'today'

imledger 发表于 2019-1-27 18:53:20

该怎么弄呢

塔利班 发表于 2019-1-28 09:57:36

from datetime import datetime

imledger 发表于 2019-1-29 15:14:44

塔利班 发表于 2019-1-28 09:57
from datetime import datetime

谢谢
页: [1]
查看完整版本: 为啥总是“ 'module' object is not callable ”