Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 21-04-2009
Member
 
Join Date: Nov 2008
Posts: 1,221
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 ()
Reply With Quote
  #2  
Old 21-04-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
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
Reply With Quote
  #3  
Old 21-04-2009
Member
 
Join Date: Nov 2008
Posts: 1,221
Re: Execution command with os.popen

Yes from the console it works, but I want it run by running my web page.
Reply With Quote
  #4  
Old 21-04-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
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 ?
Reply With Quote
  #5  
Old 21-04-2009
Member
 
Join Date: Nov 2008
Posts: 1,221
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Execution command with os.popen"
Thread Thread Starter Forum Replies Last Post
How to boost command points in Command & Conquer Tiberium Alliances? Charu Sharma Video Games 2 21-03-2012 03:23 AM
Problem: Command Line Option Syntax Error. Type Command /? For Help Nadeem MediaCenter 3 03-09-2009 05:41 PM
Linux history command and fc command Alkesh jain Operating Systems 3 26-05-2009 07:53 PM
Command Line Ren (Rename) command broken? SixSigmaGuy Vista Help 2 18-05-2008 03:30 PM
autorun.inf - shell\..\command with command line parameter doesn'twork kakii Windows XP Support 1 18-05-2007 01:24 AM


All times are GMT +5.5. The time now is 10:34 PM.