def splitquery(url):
 global _queryprog
 if (_queryprog is None):
  import re
  _queryprog = re.compile('^(.*)\\?([^?]*)$')
 match = _queryprog.match(url)
 if match:
  return match.group(1, 2)
 return (url, None)

def splitquery ( url ) : global _queryprog if ( _queryprog is None ) : import re _queryprog = re . compile ( '^(.*)\\?([^?]*)$' ) match = _queryprog . match ( url ) if match : return match . group ( 1 , 2 ) return ( url , None )
splitquery --> /path .