Skip to content

Consideration of Python 3 environment #25

@lee1043

Description

@lee1043

Current version of the code works in the Python 2 environment but not considering the Python 3 environment. Most recent version of cdms has moved toward Python 3 env.

Major differences are:

  1. usage of print
  • Py 2: print 'abc'
  • Py 3: print('abc')

We can import from __future__ import print_function at the beginning of codes which use print statement and revise print in Py 3 style, then the code will work in both Py 2 and 3 env.

  1. integer divided by integer
  • Py 2: int/int = int
  • Py 3: int/int = float

We need to make sure the code does what we want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions