Sorry if this is a Python newbie question. In my Calibre development environment, I added an html file to the calibre/resources folder as my Calibre modification needed to reference it. To figure out how to do so without hardcoding the full filepath, I searched around Calibre's source files until I found a bit of code that looked like it was referencing a folder in the resources folder. I found this on line 199 of calibre/src/calibre/gui2/viewer/documentview.py:
mjpath = P(u'viewer/mathjax').replace(os.sep, '/')
I copied this into my code and modified it to reference the html file that I added. It worked for the most part, but I'm confused as to what this code is actually doing and figured it'd be good to know if I'm using it. What is this 'P' function? Is it specific to Calibre or is it part of the os library? I noticed I had to add that in order for it to work, but I didn't have to add anything else. Searching on Google for 'python P' of course wasn't helpful.