Clickable hyperlinks

Dan Strohl D.Strohl at
Tue Jan 3 04: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 

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.

Some references:  (see 

-----Original Message-----
From: Python-list [ at] On
Behalf Of Deborah Swanson
Sent: Tuesday, January 03, 2017 1:35 PM To: 'Devin Jeanpierre' 
<jeanpierreda at>
Cc: 'comp.lang.python' <python-list at>
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
way to
>make an URL clickable is to use a terminal that makes URLs clickable,
>print the URL:
>print("%s: %s" % (description, url))
>-- Devin

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" % (" list", 

I get: list:

(Outlook made the url clickable here, the python GUI consoles just output plain 

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> 

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 mailing list