I have a Python code in which I am using useruser
as my username:
zipfolder('shared-photo.zip', 'C:\Users\useruser\company\folder-images')
How can I update this code to get the logged-in username?
For example this is what I tried:
myuser = os.popen("echo %username%").read().replace("\n","")
...and then when I print myuser
, I get the right username:
print(myuser)
How can I use this variable in my code, instead of useruser
?