title: How to write correct file path with an environment variable in python?
body: <p>I would like to write the file path with an windows environment variable for the windows username but I don't know how to write it correctly. I would like to use an env variable because I use the script on different computers.</p>
  <p>Here is the code:</p>
  <pre><code>import os
  
  os_username = os.environ.get('USERNAME')
  
  workbook = xlsxwriter.Workbook(r&quot;C:\Users\&quot; + os_username + r&quot;\Google-Drive\filename.xlsx&quot;)
  </code></pre>
  <p>The above code does not work to find the correct path.
  The code for finding the username is working.
  The file path would be for instance: C:\Users\Peter\Google-Drive\filename.xlsx</p>