--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/path2url.py Sat Mar 17 12:18:25 2018 +0000
+from argparse import ArgumentParser
+from os.path import abspath
+from urllib.parse import quote, urlunsplit
+ """ Make path absolute and turn it into file: URL.
+ Useful for creating thumbnails (following freedesktop.org spec).
+ return urlunsplit(('file', '', quote(abspath(path)), '', ''))
+if __name__ == '__main__':
+ parser = ArgumentParser()
+ parser.add_argument('path', help='file path')
+ args = parser.parse_args()
+ print(tourl(args.path))