I want to open a file in the desktop, or anywhere else in the C:/Users/USERNAME/ directory. but I don't know what the code to get the username is. for example, in batch-file programming I could use:]
c:/Users/%USERNAME%/...
I want to use it in the open function. I have tried both:
open('C:/Users/%%USERNAME/Desktop/data3.txt')
open('C:/Users/%USERNAME%/Desktop/data3.txt')
I know there should be an import that can give the username to my code. But I don't know what it is. And I also would like to know if I can use the username like %USERNAME% or %%USERNAME or a single thing that doesn't need any import.