Re: gl Multiple versions of python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James Mills

    Re: gl Multiple versions of python

    On Wed, Oct 29, 2008 at 11:50 AM, Glenn Linderman <v+python@g.nev cal.comwrote:
    >>When using multiple versions of Python co-installed on the same system,
    >>what happens with local .pyc files? If the .py is loaded with a
    >>different version of Python, is the .pyc rebuilt (even if the .py hasn't
    >>changed)?
    Worth having a look at virtualenv
    Also for test code, is there a way to test the version of python which is
    executing the code? Something like
    >
    if __name__ == "__main__"
    <code>
    #!/usr/bin/env python

    import sys

    def main():
    print sys.version
    print sys.subversion
    print sys.hexversion
    print sys.api_version
    print sys.version_inf o

    if __name__ == "__main__":
    main()
    </code>

    <output>
    2.5.2 (r252:60911, Oct 27 2008, 14:12:15)
    [GCC 4.2.4 (CRUX)]
    ('CPython', 'tags/r252', '60911')
    33882864
    1013
    (2, 5, 2, 'final', 0)
    </output>

    Read the sys documentation for the meaning
    of the attributes used aboave.

    cheers
    James

    --
    --
    -- "Problems are solved by method"
Working...