[wxpython-users] where we put the .png files?

Robin Dunn robin at alldunn.com
Thu May 1 17:35:19 PDT 2008


Abdessamad EL GON-NOUNI wrote:
> 
> 
> 2008/5/1 Mike Driscoll <mdriscoll at co.marshall.ia.us 
> <mailto:mdriscoll at co.marshall.ia.us>>:
> 
>     Abdessamad EL GON-NOUNI wrote:
> 
>         It dosn't work, he gives me the msg "Can'l load image from file
>         'Exit.png':files does not exist"
> 
> 
>     Make sure the path to your png is correct. Also, check out
>     wx.ArtProvider for standard icons. I use img2py if I need custom
>     icons because it's easier to embed them in my application.
> 
> where do I can check this path?

You are specifying the image file with no path information, so for 
wx.Bitmap to be able to find it the image file will need to be in the 
current working directory.  In other words the directory returned by 
os.getcwd().  If you don't have control over where your CWD is then 
you'll need some other way to find your images, like specifying a full 
path to the file, using the wx.StandardPaths class mentioned earlier, 
img2py, etc.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!



More information about the wxpython-users mailing list