On 08/01/18 00:17, boB Stepp wrote: >> The os.path module is mostly a string manipulation toolkit. > > This is the critical piece that was eluding me. I assumed that the > actual file system was being queried, checked and expanded as needed.
To be fair realpath() does do a tiny bit of magic in that it checks if the file (or any part of the path) is a link (aka shortcut) and tries to give you the actual path to the original file - ie it follows the link. I'm not sure how effective it is, I've only played with it but never used it in earnest. But in general I tend not to rely on os.path doing anything remotely clever. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor