def install_readline(hook):
 global readline_hook, readline_ref
 readline_hook = hook
 PyOS_RFP = c_int.from_address(Console.GetProcAddress(sys.dllhandle, 'PyOS_ReadlineFunctionPointer'))
 if (sys.version < '2.3'):
  readline_ref = HOOKFUNC22(hook_wrapper)
 else:
  readline_ref = HOOKFUNC23(hook_wrapper_23)
 func_start = c_int.from_address(addressof(readline_ref)).value
 PyOS_RFP.value = func_start

def install_readline ( hook ) : global readline_hook , readline_ref readline_hook = hook PyOS_RFP = c_int . from_address ( Console . GetProcAddress ( sys . dllhandle , 'PyOS_ReadlineFunctionPointer' ) ) if ( sys . version < '2.3' ) : readline_ref = HOOKFUNC22 ( hook_wrapper ) else : readline_ref = HOOKFUNC23 ( hook_wrapper_23 ) func_start = c_int . from_address ( addressof ( readline_ref ) ) . value PyOS_RFP . value = func_start
set up things for the interpreter to call our function like gnu readline .