def path2uri(path):
import urllib.parse<EOL>import urllib.request, urllib.parse, urllib.error<EOL>return urllib.parse.urljoin('<STR_LIT>', urllib.request.pathname2url(path))<EOL>
Return a valid uri (file scheme) from absolute path name of a file

>>> path2uri('/home/john/my_file.wav')
'file:///home/john/my_file.wav'

>>> path2uri('C:\Windows\my_file.wav')
'file:///C%3A%5CWindows%5Cmy_file.wav'