Matt Seymour

The python code to convert a url path to a file:// url.

import urlparse, urllib
path = '/Users/myuser/a.file'

urlparse.urljoin(
  'file:', urllib.pathname2url(path)
)

> output:: file:///Users/myuser/a.file