def read_str(fid, count=1):
 dtype = np.dtype(('>S%i' % count))
 string = fid.read(dtype.itemsize)
 data = np.fromstring(string, dtype=dtype)[0]
 bytestr = b('').join([data[0:(data.index(b('\x00')) if (b('\x00') in data) else count)]])
 return str(bytestr.decode('ascii'))

def read_str ( fid , count = 1 ) : dtype = np . dtype ( ( '>S%i' % count ) ) string = fid . read ( dtype . itemsize ) data = np . fromstring ( string , dtype = dtype ) [ 0 ] bytestr = b ( '' ) . join ( [ data [ 0 : ( data . index ( b ( '\x00' ) ) if ( b ( '\x00' ) in data ) else count ) ] ] ) return str ( bytestr . decode ( 'ascii' ) )
if a python string literal begins at the specified position in the given string .