D.Strohl at F5.com
Tue Jan 3 16:47:58 EST 2017
Keeping mind how this all works...
Python is providing the data, the console/terminal/app handles how that data is displayed. There is no specification for text output to be hyperlinked (that I know about at least), so while some apps may handle specific coding to tell them that "this text should be a hyperlink", most will either parse the text looking for hyper-linkable string, or more commonly, just output the text as text.
If you control the app that is displaying info to the user (such as using QT or another GUI tool), or generating html yourself, you can control if a text string is a hyperlink or not, and what to do with the hyperlink when clicked.
So, if you want clickable links, you would need to find a console/terminal that supported them.
https://opensource.com/life/15/11/top-open-source-terminal-emulators (see Gnome)
From: Python-list [mailto:python-list-bounces+d.strohl=f5.com at python.org] On Behalf Of Deborah Swanson
Sent: Tuesday, January 03, 2017 1:35 PM
To: 'Devin Jeanpierre' <jeanpierreda at gmail.com>
Cc: 'comp.lang.python' <python-list at python.org>
Subject: RE: Re: Clickable hyperlinks
Devin Jeanpierre wrote, on January 03, 2017 12:57 PM
>Sadly, no. :( Consoles (and stdout) are just text, not hypertext. The
>make an URL clickable is to use a terminal that makes URLs clickable,
>print the URL:
>print("%s: %s" % (description, url))
I'm sorry, I should have said a GUI console because I wouldn't expect a text-based console to produce clickable links. But it appears that a simple GUI console can't do it either. I have 3 GUI consoles and in all 3, when I ask:
print("%s: %s" % ("python.org list",
python.org list: https://mail.python.org/mailman/listinfo/python-list
(Outlook made the url clickable here, the python GUI consoles just output plain text.)
Pretty clearly the output is plain text because your format parameters are %s. Maybe the trick, if there is one, is in a format parameter for urls.
On Tue, Jan 3, 2017 at 11:46 AM, Deborah Swanson <python at deborahswanson.net> wrote:
Excel has a formula:
that will put a clickable link into a cell.
Does python have an equivalent function? Probably the most common use for it would be output to the console, similar to a print statement, but clickable.
More information about the Python-list