mktime (1.5 vs 2.2.1)

Alex Martelli aleax at aleax.it
Sat Mar 29 19:00:41 CET 2003


morden wrote:

> TypeError: mktime() takes exactly 1 argument (9 given)
> 
> My question is: what is a good way to get the code working on _both_ 1.5
> and 2.2?

Call mktime with a tuple of 9 items, as it's documented in 1.5.2 docs
as well as in more recent ones.

> Is there a builtin variable telling you the python interpreter version?

Not builtin, but, after 'import sys', you can use sys.version_info (a
tuple, generally handier for program use) or sys.version (a string,
with more human-readable information).


Alex





More information about the Python-list mailing list