Relative-absolute path

Hi,
I’m doing the Media-Player samples and I try to
use the media file with a relative path:

MEDIAFILE = "../panda3d/samples/Media-Player/PandaSneezes.avi"

                       
class World(DirectObject):
    def __init__(self):
        
        # crea un oggetto per la lettura vuoto
        self.tex = MovieTexture("name")
        # crea un asserzione nella lettura
        # infatti read restituisce un valore bool
        assert self.tex.read(MEDIAFILE),"Nessun Video"

It give the assert exception “not finding the file”,
but if i change the relative path with absolutely path it
runs.
It could be a bug?

Panda version 1.7.1

[/quote]

Edit:

It’s a python problem not Panda,
if I don’t open one shell and running python
manually it
don’t find relative path.sob. :frowning:

Use getModelPath().findFile(MEDIAFILE) in the read() call.

Thank you Rdb i’ll try it as soon i can

Thanks Rdb it runs.