Changeset 2412 for LMDZ5


Ignore:
Timestamp:
Dec 17, 2015, 12:11:35 PM (9 years ago)
Author:
lguez
Message:

Make the use of python or python3 more transparent.

Location:
LMDZ5/trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/tools/compare_real.py

    r2082 r2412  
    1 #!/usr/bin/env python
     1"""This script should be called by "diffdef.sh". It operates on
     2different lines with common variables. It requires version 2.7 or
     3higher of Python (it also works with Python 3).
    24
    3 # Author: Lionel GUEZ
    4 
    5 # This script should be called by "diffdef.sh". It operates on
    6 # different lines with common variables. It requires version 2.7 or
    7 # higher of Python (it also works with Python 3).
     5Author: Lionel GUEZ"""
    86
    97import sys, os.path
  • LMDZ5/trunk/tools/diffdef.sh

    r2101 r2412  
    33
    44# This script compares files "*.def" other than "traceur.def" and
    5 # "out.def" in two directories. The script uses GNU versions of the
    6 # utilities cut, sort and uniq.
     5# "out.def" in two directories.
     6
     7# This script uses GNU versions of the utilities cut, sort and uniq,
     8# and calls a Python script.
    79
    810# See guide:
     
    1820
    1921##set -x
     22
     23type python3 >/dev/null 2>&1
     24if (($? == 0))
     25then
     26    my_python=python3
     27else
     28    my_python=python
     29fi
     30
    2031set -e
    2132
     
    5162      cat plouf_$$
    5263      rm plouf_$$
     64      rm all.def
    5365      exit 1
    5466  fi
     
    8193done
    8294
    83 $script_dir/compare_real.py $*
     95$my_python $script_dir/compare_real.py $*
    8496sort common_lines --output=common_lines # was modified by the Python script
    8597echo "Created files \"./common_lines\" and \"./uniq_val\"."
Note: See TracChangeset for help on using the changeset viewer.