Changeset be75350
- Timestamp:
- 05/04/18 13:40:39 (7 years ago)
- Branches:
- master, pympi
- Children:
- 1d6ab66
- Parents:
- 5e1952a
- git-author:
- Thomas Uram <turam@…> (05/04/18 13:40:39)
- git-committer:
- Thomas Uram <turam@…> (05/04/18 13:40:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/genericio.py
r9796d0a rbe75350 38 38 # ***************************************************************************** 39 39 40 from __future__ import print_function 40 41 import numpy as np 41 42 import ctypes as ct 42 import os 43 import os,sys 43 44 44 45 #Define where the library is and load it … … 72 73 73 74 def gio_read(file_name,var_name): 75 if sys.version_info[0] == 3: 76 file_name = bytes(file_name,'ascii') 77 var_name = bytes(var_name,'ascii') 74 78 var_size = libpygio.get_elem_num(file_name) 75 79 var_type = libpygio.get_variable_type(file_name,var_name) 76 80 field_count = libpygio.get_variable_field_count(file_name,var_name) 77 81 if(var_type==10): 78 print "Variable not found"82 print("Variable not found") 79 83 return 80 84 elif(var_type==9): 81 print "variable type not known (not int32/int64/float/double)"85 print("variable type not known (not int32/int64/float/double)") 82 86 elif(var_type==0): 83 87 #float … … 102 106 103 107 def gio_has_variable(file_name,var_name): 108 if sys.version_info[0] == 3: 109 file_name=bytes(file_name,'ascii') 110 var_name=bytes(var_name,'ascii') 104 111 var_size = libpygio.get_elem_num(file_name) 105 112 var_type = libpygio.get_variable_type(file_name,var_name) … … 107 114 108 115 def gio_inspect(file_name): 116 if sys.version_info[0] == 3: 117 file_name=bytes(file_name,'ascii') 109 118 libpygio.inspect_gio(file_name) 110 119
Note: See TracChangeset
for help on using the changeset viewer.