title: Permanently adding a file path to sys.path in Python
body: <p>I had a file called <code>example_file.py</code>, which I wanted to use from various other files, so I decided to add <code>example_file.py</code> to <code>sys.path</code> and import this file in another file to use the file. To do so, I ran the following in IPython.</p>
  
  <pre><code>import sys
  sys.path
  sys.path.append('/path/to/the/example_file.py')
  print(sys.path)
  </code></pre>
  
  <p>I could see the path I had just added, and when I tried to import this file from another directory path like this:</p>
  
  <pre><code>import example_file
  </code></pre>
  
  <p>it worked just fine, but once I came out of IPython, entered it again, and checked the <code>sys.path</code>, I saw that the path which I had added was not present, so how do I add a path to sys.path permanently in Python?</p>