I have a problem loading files in pyglet (cocos2d)
In some circumstances I get errors like this:
File "/usr/local/lib/python2.7/dist-packages/pyglet/resource.py", line
399, in file
raise ResourceNotFoundException(name)
pyglet.resource.ResourceNotFoundException: Resource
"/home/mikolaj/python/mod/resources/images/walls.png" was not found on the
path.
Ensure that the filename has the correct captialisation.
However the file for sure exists in the supplied path:
mikolaj@coffee:~$ ls -l /home/mikolaj/python/mod/resources/images/
total 8
-rw-r--r-- 1 mikolaj mikolaj 769 helmi 10 12:15 floors.png
-rw-r--r-- 1 mikolaj mikolaj 707 helmi 10 12:15 walls.png
In the same method as trying to load the image, I can prove pythonically
that the file exists, and that python finds it:
import os.path as path
import os
def _parent():
this = path.abspath(__file__)
thisdir = path.dirname(this)
parentdir = path.dirname(thisdir)
return parentdir
def _interface():
return path.join(_parent(), 'resources', 'images')
print os.listdir(_interface())
outputs:
['walls.png', 'floors.png']
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/groups/opt_out.