title: How to get path to python file running through open with
body: <p>I can't seem to access the file-path I used "open-with" on</p>
  
  <p>I'm creating my own text-editor that can open files, both through a open-tab(working) and by just opening a .txt file, using my .exe file converted from the script</p>
  
  <p>I've tried a lot of different ways to access the file, but nothing seems to work</p>
  
  <pre class="lang-py prettyprint-override"><code>try:
      fileName = str(os.path.realpath(__file__))
      with open(fileName) as _file:
          contentText.insert(1.0, _file.read())
      onContentChanged()
      root.title(os.path.basename(fileName) + " - Footprint Editor")
  except:
      root.title("Untitled - Footprint Editor")
  </code></pre>
  
  <p>I try to get fileName to be equal to the path to the file I used "open with"
  when .py file is converted to a .exe</p>