I would think you could do something similar to the solution in this question, which should solve both issues. I.E., put the Python file in some location below the src
directory, and then load it using a relative path with the src
directory as the "root", using the ResourcesLoader
.
I think you could call the getPath() method on the returned URL to achieve your needs, but I haven't tried this.