Python 'AttributeError: 'function' object has no attribute 'min''

后端 未结 6 2208
予麋鹿
予麋鹿 2021-02-07 15:12

Firstly, apologies for how obvious these two questions seem to be; I\'m very very new to this and don\'t have a clue what I\'m doing.

I\'m trying to write something to a

6条回答
  •  北恋
    北恋 (楼主)
    2021-02-07 15:47

    I encountered a similar error when I called timezone.now instead of timezone.now(). I then tried to format the DateTime value that I was expecting. But it wasn't a DateTime; it was a function. This resulted in an error message about 'Month' not being an attribute of 'function'.

    The fix was to simply add the parentheses after now. This called the now function and returned its result, instead of returning the now function object itself.

    Silly mistake, I know. But not easy to troubleshoot.

提交回复
热议问题