Changeset 2786 in lmdz_wrf for trunk/tools/generic_tools.py


Ignore:
Timestamp:
Jan 14, 2020, 2:41:49 PM (5 years ago)
Author:
lfita
Message:

Adding detection of unicode/string values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2783 r2786  
    38723872    string=''
    38733873    for i in range(Nvals):
     3874        if type(vec[i]) == type('Str') or type(vec[i]) == type(u'1'):
     3875            vecS = vec[i]
     3876        else:
     3877            vecS = str(vec[i])
    38743878        if i == 0:
    3875             string = str(vec[i])
     3879            string = vecS
    38763880        else:
    3877             string = string + char + str(vec[i])
     3881            string = string + char + vecS
    38783882
    38793883    return string
Note: See TracChangeset for help on using the changeset viewer.