How to open up a web browser?

Could anyone tell me how to open up a link / web browser from the game engine?

Here’s what I would like to learn how to do:

There’s a cube in the scene, I roll over it with the mouse, left click, and my browser pops up with a link to

So, I know how to get the mouse to show & how to click on the cube to get some end result (ie color change, movement, etc). But is there some Actuator that I’m missing here, it seems like it should be so simple to click on a cube and have a link open in the web browser… maybe I’ve just skipped over it.

well, many thanks in advance!

Hi here is a little script for you:

import os

the only reason that works is because Explorer is in the systems Path= field.

If you wanted to launch the default browser, just include a URL link with your game, and use the above script like this:

 import os
 os.system('your shortcut name here')

make sure the URL shortcut is in the same directory/folder as your .blend file.
Be sure to launch blender by clicking on the .blend file, or you will get a file not found error.(dont use blenders built in file browser, it seems to get lost for some #$%^ing reason)

anyway! hope that helps you out :smiley:

To get the mouse to show, all you need is

import Rasterizer


then, attach the script to a camera with an Always sensor, and Python controller

Python comes with a browser luancher that will launch the default browser, but there is specific code for linux/windows/mac:

Webbrowser Module:

import webbrowser