[GRASS-user] Newbie, running python on Mac, error on execl

Hi,

I have just started writing scripts using python for Grass on Mac. I copied
the example below from the library and ran it.

"
#!/usr/bin/env python

#%module
#% description: Checks if vector map is 3D
#% keywords: vector
#%end
#%option
#% key: map
#% type: string
#% gisprompt: old,vector,vector
#% key_desc: name
#% description: Name of vector map
#% required: yes
#%end

import sys
import grass.script as grass

def main():
    info = grass.parse_command('v.info',
                               flags = 't',
                               map = options['map'])
    return 0

if __name__ == "__main__":
    options, flags = grass.parser()
    sys.exit(main())

"
When I ran the program using the GUI, it gave me an error without
explanation, so I tried the command line running from inside the Grass:

"python hi.py map=geology@PERMANENT"

and I got the following error:

"execl() failed: Permission denied"

I would appreciate if anyone can help.

Ahmad
--
View this message in context: http://n2.nabble.com/Newbie-running-python-on-Mac-error-on-execl-tp4860279p4860279.html
Sent from the Grass - Users mailing list archive at Nabble.com.

The first thing to check would be the file permission bits on the file
"hi.py" to be sure the execute bit is set. From your command line, just
type "ls -al hi.py". The first 10 characters from the output should show
you what bits are set and you are looking for an "x" in the fourth
character. For example:

-rwxr--r--

This means the owner has read,write,execute privileges while group and world
have read only. If you don't have execute privileges, simple type:

"chmod u+x hi.py"

Hope this helps. The same thing was driving me batty until this morning on
a Linux machine after splitting a script into two parts. The old one had
the execute bit set but the new one didn't.

Randy

On 04/06/10 12:31 PM, "AhmadKhaled" <vbkhp@yahoo.com> wrote:

"python hi.py map=geology@PERMANENT"

and I got the following error:

"execl() failed: Permission denied"