title: Loading JSON file from another directory in Python
body: <p>I am trying to read in a JSON file called league.json from a python file called run_test.py. The JSON file is in a different directory. I am running Windows 10 and python 3.8.6 in Visual Studio.</p>
  <ul>
  <li>The directory I'm running the python file in is: C:\Users\my_un\Documents\folder1\folder2\model\run_test.py</li>
  <li>The directory I am trying to load the json file from is:
  C:\Users\my_un\Documents\folder1\folder2\config\league.json</li>
  </ul>
  <p>Based on documentation I've found, the below code should work, but I keep getting the error: FileNotFoundError: [Errno 2] No such file or directory: 'config\league.json'.</p>
  <p>This does run successfully when I move league.json to the same directory as the python file, and change the open location to: '.\league.json'.</p>
  <p>What am I doing wrong? My code is below. Thanks in advance.</p>
  <pre><code>import json
  
  with open('.\config\league.json', 'r') as f:
      config = json.load(f)
  
  print (len(config))
  </code></pre>