を持っていないです私のTransaction
クラス:私ははAttributeError: 'モジュール' オブジェクトには、属性 'のstrptime' ここ
tr = Transaction('AAPL', 600, '2013-10-25')
print tr.date
:
class Transaction(object):
def __init__(self, company, num, price, date, is_buy):
self.company = company
self.num = num
self.price = price
self.date = datetime.strptime(date, "%Y-%m-%d")
self.is_buy = is_buy
そして私はdate
関数を実行しようとしているとき次のエラーが表示されます:
self.date = datetime.strptime(self.d, "%Y-%m-%d")
AttributeError: 'module' object has no attribute 'strptime'
どうすれば修正できますか?
'日時輸入datetime' –