file:///home/ashu/Music/Collections/randomPicks/ipod%20on%20sep%2009/Coldplay-Sparks.mp3
How can I convert a string like the one above to get a normal file path that I can pass to a function open()?
open()
Take a look url2pathname:
url2pathname
import urllib2 path = urllib2.url2pathname("file:///home/ashu/Music/Collections/randomPicks/ipod%20on%20sep%2009/Coldplay-Sparks.mp3")
This is called unquote. Available from urllib.
import urllib urllib.unquote('%20')
Source: https://habr.com/ru/post/1783058/More articles:before_filter is inherited incorrectly from the parent controller? - ruby-on-rails-3Redirect to index # tab1 - ruby-on-railsAny rails plugins / jewels for detecting lost entries? - databasejQuery / Tablesorter: support secondary alphabetical view - javascriptJQuery Bind a click event to an added element with an argument - javascriptПредварительная обработка GCC, для чего предназначены встроенные и командной строки? - cWhat is a good JSON serialization library for Scala 2.8.1 for use in Eclipse - gitCan anyone recommend a C or Java based open source scheduler for implementation as a basis for another program? - javaOnly add if they are not already installed - javascriptPython Backend Logic Adding MVC Framework (Django) - pythonAll Articles