MCPcopy Create free account
hub / github.com/NatLabRockies/windtools / write_type

Method write_type

windtools/io/binary.py:123–128  ·  view source on GitHub ↗
(self,val,type)

Source from the content-addressed store, hash-verified

121 self.f.write(val)
122
123 def write_type(self,val,type):
124 if hasattr(val,'__iter__'):
125 N = len(val)
126 self.f.write(struct.pack('{:d}{:s}'.format(N,type),*val))
127 else:
128 self.f.write(struct.pack(type,val))
129
130 # aliases
131 def write_int(self,val):

Callers 6

write_int1Method · 0.95
write_int2Method · 0.95
write_int4Method · 0.95
write_int8Method · 0.95
write_floatMethod · 0.95
write_doubleMethod · 0.95

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected