Referencing a specific folder location for different users to pull csv files

Viewed 17

I want to put a python executable on multiple machines, but each has a different user name. However, each computer has the documents folder mapped the same way, just a different user name.

I guess the question is how do I reference/change the directory address based on what machine I'm on without having to change the code for each executable?

ex (Want to change the path to match what "CPU" is being used):

folder_path = r'C:\Users\CPU1\Documents\file.xlsx'

folder_path = r'C:\Users\CPU2\Documents\file.xlsx'

0 Answers
Related