Possible Duplicate:
datetime.datetime.strptime not present in Python 2.4.1
I have a machine that has python 2.4 installed, I’m in the middle of writing a script, and want to use the strptime function from datetime, however it is not in 2.4, how do I install the 2.5 version of datetime on 2.4?
I know I can upgrade the machine to python 2.5, but that is not possible at the moment.
Thanks
Not always but look at the source code of the module in Python 2.5. If the function in question is implemented in Python, chances are good that you can simply copy the code.
Two things to note:
Pay attention to the Python copyright. If you copy code from one module, that code is subject to Python’s copyright license.
Write test cases to make sure the code works. Add a test case which fails as soon as the original code becomes available so you can clean your code when you can move the whole project to Python 2.5.
Your specific question is answered here: datetime.datetime.strptime not present in Python 2.4.1