title: Referencing a YAML config file, from Python, when a softlink is defined
body: <p>I have the following code;</p>
  
  <pre><code>#!/usr/bin/env python3
  
  import yaml
  
  with open('config.yml', 'r') as config_file:
      config = yaml.load(config_file)
  </code></pre>
  
  <p>The file is called <code>__init__.py</code> which is in the directory <code>~/bin/myprogram/myprogram/</code> and in the same directory, I have a file called <code>config.yml</code></p>
  
  <p>My symlink is as follows;</p>
  
  <pre><code>user$ ls -la /usr/local/bin/
  
  lrwxr-xr-x    1 user  admin        55 27 Nov 13:25 myprogram -&gt; /Users/user/bin/myprogram/myprogram/__init__.py
  </code></pre>
  
  <p>Every time I run myprogram, I get the error <code>FileNotFoundError: [Errno 2] No such file or directory: 'config.yml'</code>. I believe this is because the <code>config.yml</code> is not in <code>/usr/local/bin/</code>. What is the best way to work around this issue?</p>