Results 1 to 5 of 5

Thread: Execution command with os.popen

  1. #1
    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 ()

  2. #2
    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

  3. #3
    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.

  4. #4
    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 ?

  5. #5
    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

Similar Threads

  1. Replies: 2
    Last Post: 21-03-2012, 03:23 AM
  2. Replies: 3
    Last Post: 03-09-2009, 05:41 PM
  3. Linux history command and fc command
    By Alkesh jain in forum Operating Systems
    Replies: 3
    Last Post: 26-05-2009, 07:53 PM
  4. Command Line Ren (Rename) command broken?
    By SixSigmaGuy in forum Vista Help
    Replies: 2
    Last Post: 18-05-2008, 03:30 PM
  5. Replies: 1
    Last Post: 18-05-2007, 01:24 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,057,351.87179 seconds with 16 queries