I wrote a simple python script in which I have used the Python Global-Hotkeys Module to make a simple script which does nothing but wait for some key-combination to be pressed and once the key combination is pressed, the script turns off the external monitors I have attached to my PC. It was working great and I am very happy with the way everything has panned out. Now, I wanted this script to start as soon as Windows starts, so I used Pyinstaller to convery my .py file to .exe and added a shortcut of the .exe file in my startup. I added the same shortcut in my laptop as well. I have Kaspersky Total Security in PC and Windows Defender in laptop. In PC, when I scan the same converted .exe with Kaspersky anti virus, it says 'no threats' whereas in my laptop the same file is being classified as a 'Trojan'. Why is this, what am I missing here ?
the problem is that your program is listening for keystrokes and that's totally fine as you have coded it yourself and the windows defender may think the program as a keylogger or something