Matt Seymour

Last month I wrote the article 'How to convert a file path into a file url'. This month lets convert a file url into a python file path.

import urlparse, urllib

file_url = 'file:///Users/auser/a.file'
file_path = urllib.url2pathname(urlparse.urlparse(file_url).path)
> output: /Users/auser/a.file