Is there a way to call function without passing its parameters?

Viewed 3324

Iam new in information security and iam trying to teach my self how to build a simple keylogger with python, i found this code in a site :

import pythoncom, pyHook

def OnKeyboardEvent(event):
    print 'MessageName:',event.MessageName
    print 'Message:',event.Message
    print 'Time:',event.Time
    print 'Window:',event.Window
    print 'WindowName:',event.WindowName
    print 'Ascii:', event.Ascii, chr(event.Ascii)
    print 'Key:', event.Key
    print 'KeyID:', event.KeyID
    print 'ScanCode:', event.ScanCode
    print 'Extended:', event.Extended
    print 'Injected:', event.Injected
    print 'Alt', event.Alt
    print 'Transition', event.Transition
    print '---'

    # return True to pass the event to other handlers
    return True

# create a hook manager
hm = pyHook.HookManager()
# watch for all mouse events
hm.KeyDown = OnKeyboardEvent
# set the hook
hm.HookKeyboard()
# wait forever
pythoncom.PumpMessages()

and while i was trying to understand this code, i found the call of the function 'OnKeyboardEvent' without giving it's parameter

hm.KeyDown = OnKeyboardEvent

So my question is : is there a way in python to call a function without giving it the parameter ?

3 Answers
Related