I am trying to understand keylogger code (for ethical hacking) on YouTUBE
But I cannot understand the purpose of
Why not simply open writable file and then close when the program terminates?
What is the logic to the above approach? Is there some sort of best practice? Please clarify
This is because if your file already has any data, then the keylogger will first combine all the old data and new data together and then finally write it into your output file. If it directly writes it then the old data will be vanished...
Yeaa!
you can try using f=open('c:\output.txt', 'a')
the 'a'
here will then append data and the old data will be automatically saved....
try this out! may be this helps solve your problem