I am looking to create a log file on a users desktop, but since I do not know the username of the person using the computer I cant give my program the directory of where to place the file.
This is what works on PC since my username is mikur.
file = open("C:\\Users\\Mihkel\\Desktop\\KeyLog.txt", 'a')
I have tried using
file = open("C:\\Users\\Public\\Desktop\\KeyLog.txt", 'a')
but that gives me a no permissions error. Is there a solution to this?