Updated 2022-05-21 0
Viewed 2 times
0

I was making a module for my friend, which knows of basically nothing on the coding side of things, so I had a setup.py which will put things from the download folder to the folders the projects need to be in. However, my friend does not know their computer username, so I used os.getlogin(), but when I try to put the variable I assigned the value to into the file paths, it gives multiple errors.

Here is my current code:

import os

user = os.getlogin()

os.rename(r"C:\Users\"" + user + "\FILEPATH\FILEPATH\FILENAME", r"C:\Users\"" +
         user +"\FILEPATH\FILEPATH\FILENAME")
🔴 No definitive solution yet