Clickable hyperlinks
Chris Angelico
rosuav at gmail.com
Wed Jan 4 06:15:46 EST 2017
On Wed, Jan 4, 2017 at 10:43 PM, Deborah Swanson
<python at deborahswanson.net> wrote:
> I'm quite well aware by now that there is no one-sentence answer to my
> original question, if there's any coherent answer at all. Them's the
> breaks. Live with it or live without it, it doesn't care.
Yeah, there's no simple answer; however, you'll find that Python on many
platforms is entirely capable of popping a URL up in the user's default
browser. Check this out:
>>> import antigravity
This uses the 'webbrowser' module, which knows about a number of different ways
to open a browser, and will attempt them all. So if you can figure out the UI
part of things, actually making the link pop up in a browser isn't too hard;
for instance, if you're doing OAuth at the command line and need the user to go
and authenticate, you can simply webbrowser.open("http://......./") and it'll
DTRT.
ChrisA
More information about the Python-list
mailing list