title: Using Tkinter command "iconbitmap" to set window icon
body: <p>I have a program with a Tkinter window and I want to set an icon for the window. I use this code:<code>window.iconbitmap(os.path.dirname(os.path.abspath(__file__))+&quot;/icon.png&quot;)</code> but the following error is thrown:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;myprogram.py&quot;, line 241, in &lt;module&gt;
      window.iconbitmap(os.path.dirname(os.path.abspath(__file__))+&quot;/icon.png&quot;)
    File &quot;/usr/lib/python2.7/lib-tk/Tkinter.py&quot;, line 1591, in wm_iconbitmap
      return self.tk.call('wm', 'iconbitmap', self._w, bitmap)
  _tkinter.TclError: bitmap &quot;/home/guest/documents/myprogramdir/icon.png&quot; not defined
  </code></pre>
  <p>I think it is because I have the icon file in the same directory with the rest of my code. But that's how I want it to be. Is there a solution?</p>