Skip to content

Python neo_util

David Jeske edited this page May 17, 2017 · 3 revisions
# neo_util module

#  These functions are extremely fast "generic" character
#  escapers. We use them because C is fast and Python is slow. 

def escape(STRING:src,CHAR:prefix,STRING:string_of_chars): STRING
def unescape(STRING:src,CHAR:prefix) : STRING

#  This function instantiates an HDF_DATASET object. 

def HDF() : HDF_DATASET

For example, to do HTTP URL escaping you could do:

  fixed_url = escape(my_url,"%"," &=/?")
  if my_url != unescape(fixed_url,"%"):
    raise "this shouldn't happen"

Clone this wiki locally