I need to add a directory in home at the beginning of a python program. The problem is that when I'm using different machines I need to edit that line every time to match the right username.
e.g:
sys.path.insert(0, '/home/user_foo/directory')
on computer 1
sys.path.insert(0, '/home/user_bar/directory')
on computer 2
Is there a way in Python3 to get the user name? Or am I doomed to rewrite this line each time I pull it from git on another machine with a different user?