我们的团队在某些情况下需要使用Python 2.4.1。 strptime
不存在于datetime.datetime
模块中在Python 2.4.1:datetime.datetime.strptime在Python中不存在2.4.1
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.strptime
Traceback (most recent call last):
File "<string>", line 1, in <fragment>
AttributeError: type object 'datetime.datetime' has no attribute 'strptime'
如2.6反对:
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.strptime
<built-in method strptime of type object at 0x1E1EF898>
虽然打字时,我发现它的2.4.1时间模块中:
Python 2.4.1 (#65, Mar 30 2005, 09:16:17) [MSC v.1310 32 bit (Intel)]
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.strptime
<built-in function strptime>
我认为strptime
在某一点上移动?什么是检查这样的事情的最好方法。我试图通过python的发布历史,但找不到任何东西。
这说明了一切 - 我认为我检查了文档,看它是否在提及时提及,但我显然错过了这一点。谢谢! – Nathan 2011-04-07 19:09:57