Clickable hyperlinks

Michael Torrie torriem at gmail.com
Tue Jan 3 03:51:36 EST 2017


On 01/03/2017 08:28 PM, Deborah Swanson wrote:
> I think you're making this too complicated. I meant a console in a GUI
> application.

Ahh. Well, a "console in a GUI application" is whatever you make it[1]. There's 
no single "GUI console" hence my confusion and the confusion expressed by the 
other poster.  I was under the impression you are talking about printing 
something to standard out with, for example, print().  Is this so, or are you 
using a GUI toolkit to construct your application.  What GUI toolkit are you 
using?  As I said, in Qt or GTK there are various ways to display hyperlinks.  
For example, Qt lets you place a hyperlink in a form, or inside of a text 
entry/display widget.

I still get the impression that you're working with standard out, using 
print(). If so, then no, there's not going to be a way to force the OS to make 
the output clickable, at least on Windows.

> Not true. Pycharm uses links in it's console output, they just aren't
> internet links. They link back to lines of code being referred to.

I think the problem here is the terminology with specific meaning in Windows 
and Linux.  I'm referring to either the Win32 console window (which is where 
cmd.exe runs), or a terminal emulator in Linux, which is where you can interact 
with the bash shell and run command-line programs.  When people normally run 
python apps that are not graphical, they normally do it from the Windows 
console (via cmd.exe) or in Linux from Bash running in a terminal emulator.  
Graphical apps do their own thing as far as displaying data and making windows 
with clickable links in them.

[1] PyCharm and IDLE make "console" windows that are really normal GUI windows 
and they direct the output from Python apps there. They may also choose to 
display clickable links for things like errors. But once the app is run outside 
of PyCharm, the output of the app would go to either a Windows console window, 
or a terminal in Linux.  If you wanted your app to make it's own window and 
display clickable links, you're back to looking at a GUI toolkit (which is what 
PyCharm and IDLE are built with) like Qt, GTK, Tk, wxWidgets, or something 
else.




More information about the Python-list mailing list