title: How to get full path to python program including filename within the program?
body: <p>I have a python program, and I want to get the path to the program from within the program, but INCLUDING the file name itself. The name of my file is PyWrapper.py. Right now I'm doing this:</p>
  
  <pre><code>import sys,os
  pathname = os.path.dirname(sys.argv[0])
  fullpath = os.path.abspath(pathname)
  print fullpath
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code> /home/mrpickles/Desktop/HANSTUFF/securesdk/src/
  </code></pre>
  
  <p>This is the path to the directory in which my file is saved, but I would like it to output:</p>
  
  <pre><code>/home/mrpickles/Desktop/HANSTUFF/securesk/src/PyWrapper.py/
  </code></pre>
  
  <p>Which is the path, including the filename itself. Is this possible? Thanks.</p>