Changeset 24726
- Timestamp:
- 04/22/20 20:46:04 (5 years ago)
- Location:
- issm/trunk-jpl/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/scripts/BinRead.py
r24225 r24726 5 5 import struct 6 6 from argparse import ArgumentParser 7 8 7 9 8 def BinRead(filin, filout='', verbose=0): #{{{ … … 123 122 #}}} 124 123 125 126 124 def FormatToCode(format): # {{{ 127 125 """ … … 154 152 return code 155 153 # }}} 156 157 154 158 155 def CodeToFormat(code): # {{{ … … 187 184 # }}} 188 185 189 190 186 if __name__ == '__main__': #{{{ 191 if 'PYTHONSTARTUP' in environ:192 PYTHONSTARTUP = environ['PYTHONSTARTUP']193 print('PYTHONSTARTUP = {}'.format(PYTHONSTARTUP))194 if path.exists(PYTHONSTARTUP):195 try:196 exec(compile(open(PYTHONSTARTUP).read(), PYTHONSTARTUP, 'exec'), globals())197 198 except Exception as e:199 print("PYTHONSTARTUP error: ", e)200 else:201 print("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP))202 203 187 parser = ArgumentParser(description='BinRead - function to read binary input file.') 204 188 parser.add_argument('-f', '--filin', help='name of binary input file', default='') -
issm/trunk-jpl/scripts/OutbinRead.py
r24725 r24726 128 128 129 129 if __name__ == '__main__': #{{{ 130 if 'PYTHONSTARTUP' in environ:131 PYTHONSTARTUP = environ['PYTHONSTARTUP']132 print('PYTHONSTARTUP = {}'.format(PYTHONSTARTUP))133 if path.exists(PYTHONSTARTUP):134 try:135 exec(compile(open(PYTHONSTARTUP).read(), PYTHONSTARTUP, 'exec'), globals())136 137 except Exception as e:138 print("PYTHONSTARTUP error: ", e)139 else:140 print("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP))141 142 130 parser = ArgumentParser(description='OutbinRead - function to read binary input file.') 143 131 parser.add_argument('-f', '--filin', help='name of binary input file', default='')
Note:
See TracChangeset
for help on using the changeset viewer.