Convert local path to UNC path in Python

I recently had the need to convert a local path to a UNC path for an application I was writing. The application monitors a local folder for files and serves them to a client over the network as requested, but for the client to be able to access the file the path had to be a UNC path.

There didn’t seem to be a built in way to do this in Python so here’s what I ended up with.

more ...