title: How to open JSON file from another directory
body: <p>I am trying to open JSON file which is located in another directory, and receiving error:</p>
  <blockquote>
  <p>FileNotFoundError: [Errno 2] No such file or directory:</p>
  </blockquote>
  <p>I understand that if I provide relative path, the file has to be in same directory, otherwise the full (root) path has to be provided.</p>
  <p>My question is how to avoid it, as at the moment I test it locally, but the code is being used by other people so obviously the path can't be from my root.</p>
  <p>Any idea of how to resolve it?</p>
  <p>Here is the code:</p>
  <pre><code>with open(&quot;example.json&quot;) as commands:
          commands = json.load(commands)
  </code></pre>