def _write_w(filename, vertices, data):
 assert (len(vertices) == len(data))
 fid = open(filename, 'wb')
 fid.write(np.zeros(2, dtype=np.uint8).tostring())
 vertices_n = len(vertices)
 _write_3(fid, vertices_n)
 for i in range(vertices_n):
  _write_3(fid, vertices[i])
  fid.write(np.array(float(data[i]), dtype='>f4').tostring())
 fid.close()

def _write_w ( filename , vertices , data ) : assert ( len ( vertices ) == len ( data ) ) fid = open ( filename , 'wb' ) fid . write ( np . zeros ( 2 , dtype = np . uint8 ) . tostring ( ) ) vertices_n = len ( vertices ) _write_3 ( fid , vertices_n ) for i in range ( vertices_n ) : _write_3 ( fid , vertices [ i ] ) fid . write ( np . array ( float ( data [ i ] ) , dtype = '>f4' ) . tostring ( ) ) fid . close ( )
write a w file .