Closed pryley closed 2 years ago
Wow! Thanks, @pryley. Sorry to bother you with such a mundane beginner question.
I ran this in my setup Python 3.9.7, and got the following exception.
ModuleNotFoundError: No module named 'urllib2'
I tried pip install urllib
and found via StackOverflow that urllib
was split into urllib.parse
, urllib.request
, and urllib.error
in Python 3. But trying to pip install any of these, I get this error. ERROR: No matching distribution found for urllib.parse
. Do you have suggestions? Maybe pip isn't used to install this module. Does it come packaged with python?
Ah, for python3 you can do this: from urllib.parse import unquote
And then: path = unquote(archive_url[len("file://"):])
Thanks again. It worked perfectly. I looked again at the urllib.parse documentation and now see the syntax for unquote. I stumbled at my confused idea that the module needed to be installed. The from urllib.parse import unquote
wasn't clear. But all is better in the universe.
You can get the zettelkasten path with this (
alfred-path.py
):