Currently I'm trying to save the username as a variable. Since this script will be going to other people, I'm trying to find the username, and save it as a variable, then use that variable in filepaths. Ex:
import getpass
username = getpass.getuser()
os.chdir('/home/{username}/')
<other code>
I'm still very new to Python, so if you can help me, and explain what it does, that would be greatly appreciated. Using Linux Ubuntu, so Windows solutions wouldn't be very helpful.
EDIT:
As it python 2.7 the above f-string won't work. Use '/home/{}/'.format(username) – Sergey Pugach
Thank you Sergey Pugach, that solved my problem perfectly. Thank the rest of y'all for solving my question within the pass 2 hours. Have a nice day!