- Timestamp:
- Jun 19, 2016, 2:01:30 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r894 r896 40 40 # significant_decomposition: Function to decompose a given number by its signifcant potencies 41 41 # singleline_printing_class: Function to print all the values of a given class in a single line to be parseavel 42 # str_list: Function to obtain a list from a string givin a split character 42 43 # subbasin_point: Function to provide sub-basins given a grid point following a matrix of trips 43 44 # unitsdsDate: Function to know how many units of time are from a given pair of dates … … 7814 7815 return hexcol 7815 7816 7817 def str_list(string, cdiv): 7818 """ Function to obtain a list from a string givin a split character 7819 string= Strring from which to obtain a list 7820 cdiv= character to use to split the string 7821 >>> str_list('1:@#:$:56', ':') 7822 ['1', '@#', '$', '56'] 7823 >>> str_list('1@#$56', ':') 7824 ['1@#$56'] 7825 """ 7826 fname = 'str_list' 7827 7828 if string.find(cdiv) != -1: 7829 listv = string.split(cdiv) 7830 else: 7831 listv = [string] 7832 7833 return listv 7834 7816 7835 #quit() 7817 7836
Note: See TracChangeset
for help on using the changeset viewer.