DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Python (http://www.daniweb.com/forums/forum114.html)
-   -   python+apache+gnome-open (http://www.daniweb.com/forums/thread156204.html)

serious123 Nov 9th, 2008 10:31 am
python+apache+gnome-open
 
Hi,

I am trying to run a python(2.5.1) script on apache2.

Basically, I want that when I run this script in the browser on the web server, a gnome windows pops up. The code is as follows:
import subprocess

def launchExplorer():
    path = '/home/robot/Music'
    command = ["/usr/bin/gnome-open",path]
    subprocess.call(command)

if __name__ == "__main__":
    print_header()
    launchExplorer()

When I run this script from the shell, a gnome window pops alright, but when I run it from
the browser, I get the following error in the browser (the apache error log doesn't say anything)

cannot open display: Run 'nautilus --help' to see a full list of available command line options.

What might be going wrong? It cannot be a python problem since it works fine from the console. Is it some apache or browser configuration issue.


All times are GMT -4. The time now is 3:25 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC