Display a link in Python

Started by
4 comments, last by Kylotan 17 years, 9 months ago
I would like to know how to display a link in Python that someone could click on while running a Python program.
Nintendo
Advertisement
Well you're not being very specific.

Have you looked through the docmentation for a that might work module?

The Vaults of Parnassus has a a lot of internet modules you might want to look at.

I can't help you beyond that as I'm only just learning, but I you might want to be as specific in your questions as possible or no one will be able to help you.
Okay. I meant to say in my text-based RPG game that I made in python, I would like to put a link to a website in one of the sections of the game. I tried just typing the address, (http://www.freewebs.com/idaliengames) but that does not work. Is there a way to do this or do they have to copy and paste?
Nintendo
They must copy and paste unless you create your own text-box control which is enabled for such a thing. There may be some already available. Try looking at pygame.org.
In regard to the Original Poster:

That is terminal dependent. In Linux and other terminals, the link is clickable by default. However, in DOS/Windows, I think not. However, you can in fact use one of the modules which sadly I forgot which, and call one of it's functions and it'll open a browser window (The default browser) and open the page specified. So you can do something like 'Would you like to open the page? Y/n' and if one presses Y, it opens, etc. Unless you want to just open it without letting them know first, or probably you can warn them that in a certain time frame it'll open. Again, unfortunately I don't remember the module, browser? I don't know.
Alternatively, the HTML control in wxPython might be useful.

This topic is closed to new replies.

Advertisement