rbt wrote:

> Is there a recommended or 'Best Practices' way of checking the version
> of python before running scripts? I have scripts that use the os.walk()
> feature (introduced in 2.3) and users running 2.2 who get errors.
> Instead of telling them, 'Upgrade you Python Install, I'd like to use
> sys.version or some other way of checking before running.

I like

import os

try:
    os.walk
except AttributeError:
    # implement fallback

No need to remember in which version the desired feature came to be.

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to