Launch an external program

How could i run another program using Blender?..

Imagine a simple scene with a cube, when you touch the cube Blender launches winamp with a song(or a certyain Excel file etc…)
I ask this because i know that blender can launch another window while is running through the web plug-in, so instead of running on internet Explorer,my idea is to make a Stand-alone that could trigger another program, i know that the Extractor script could call an external program (Irfan View in that case), is this possible in game engine?Do i need python?




I believe the command os.spawn will do it, but the os module is only avalible when python is installed I believe, and it should not be avaliable in the web plugin. [you also need to remember to import os]

Now that sounds pretty interesting… To have a 3D icon launcher for apps. Will keed an eye on the thread.

Well, the original idea was to create a 3D desktop, so when you open a session in your computer a blender scene loads in fullscreen…the scene would be like a room with a Television, Hi-Fi player etc. for example when you walk through the room and click on the television the external program loads and let you choose the file you want to play…

Thanx for the answers, i’ll try to dig in some scripts to see what i can find

Great! Keep us informed! I wanna have a 3D desktop too! Watch out, Sun!

So anyone want to post an example of how it can be done using python? I am also thinking about buiding a 3D desktop but don’t know much scripting…

Sounds nice. Hope you’ve got lots of system resources to spare. :smiley:


Hug my 9600 XT. :smiley:

Hug my GeForce 4 128 Ti :wink:

Hug my 9600XT 128 again… 8)

So can anyone provide an example of how this is done? I mean using script to launch external apps, not hugging a graphic card. :smiley:

os.spawnl(os.P_NOWAIT, "C:\\Windows\

I don’t know and can’t comment on the different intracies of the commands os.spawnl os.spawnle os.spawnv and os.spawnve, but that call above should start notepad without freezing blender

This is very much possible! I did it once to launch an exe for a bik movie. The only limitaion is that I don’t know how to use Blender’s Game Engine to open up directories or look into Windows registry. If you take a look into gorgan_almighty’s fmv-ed code it shows how to launch an external object outside of blender. The problem is that the link to his site has been down for quite some time now. Maybe one of the blender heads hear has a copy of it somewhere. The one I had was lost with a hard drive failer. But yeah it is possible.

I tried that but got this message on the console:
NameError: name ‘os’ is not defined

Any clues?

Nevermind, forgot to do a import os. And it worked fine !!
Already learnt that :wink:

Yay it worked! People expect to see the most dynamic, beautiful and usable desktop in 2 weeks :smiley:

I got it to work on 2.33a but not on 2.25 Publisher…

First, thnx very much to z3r0 d for the code :smiley:

Second, to arangel i have just tested with 2.25 and it works, with python 2.0 and with 2.2

i just put the code

import os
os.spawnl(os.P_NOWAIT, “C:\Windows

and then in game engine assign to an Empty–>sensor:mouse and controller:python pointing to the code.

if i find a clue to your problem i´ll try to help you