Changeset 623 in lmdz_wrf


Ignore:
Timestamp:
Aug 21, 2015, 6:25:15 PM (10 years ago)
Author:
lfita
Message:

Adding function Nchar: Function to provide 'N' times concatenated 'string'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r606 r623  
    147147    return boolv
    148148
     149def Nchar(N,string):
     150    """ Function to provide 'N' times concatenated 'string'
     151      N= number of copies
     152      strin= string to reproduce
     153    >>> Nchar(4,'#')
     154    ####
     155    """
     156    fname = 'Nchar'
     157
     158    newstring=''
     159    for it in range(N):
     160        newstring=newstring + string
     161
     162    return newstring
    149163
    150164def variables_values(varName):
Note: See TracChangeset for help on using the changeset viewer.