Execution command with os.popen
I try to run a command in a python script that I want to run the following in a web page, for that I used the spawn with os.popen (), but the problem is that I run the python script directly with all works well, while running from the server I have the following error message:
WindowsError: [Error 5] Access denied: 'C:\\WINDOWS\\system32\\cmd.exe /c gdal_translate wcs.xml wcs.tif'
here's part of my script or do I call:
# The command to execute
com = 'gdal_translate C:\Inetpub\wcs.xml C:\Inetpub\wcs.tif'
# Spawn process:
child = os.popen (com)
child.close ()
Re: Execution command with os.popen
In my opinion, is more a network issue than anything else. Try to go on your server to open a console window and type
Code:
gdal_translate C:\Inetpub\wcs.xml C:\Inetpub\wcs.tif
Re: Execution command with os.popen
Yes from the console it works, but I want it run by running my web page.
Re: Execution command with os.popen
So from what I read, you're on your client. Your web page (probably written in php) that is located on the http server and you would like this web page (hence the http server) launches "gdal_translate C:\Inetpub\wcs.xml C:\Inetpub\wcs.tif", the Inetpub folder is thus located at the root of your server ...
Why go through Python? Why not start a system () in php? What is your http server ?
Re: Execution command with os.popen
I work with the specification that is under PyWPS python and I have to program my script in python, I use the IIS server, and try to run any command from the server but I always the message Access Denied