[Tutor] Have any idea why I do not have access to MY files?
hcohen2 at comcast.net
Wed Jan 28 11:49:30 EST 2004
Michael Janssen wrote:
>On Wed, 28 Jan 2004, hcohen2 wrote:
>>These are excution functions: system() and popen(). For the same file
>>with the former I can see the contents:
>> >>> result = os.system('cat new2text.py')
>>y = 0
>>print 'y is currently:', y
>>while y < 8:
>> y += 1
>> print 'incrementing y to: ', y
>>whereas, if I try to read it - suddenly it does not belong to me!
>> >>> f = os.popen('import2.py -a')
>> >>> sh: line 1: ./import2.py: Permission denied
>>But if I do this, its mine!
>> >>> result = os.system('ls -l new2text.py')
>>-rw-r--r-- 1 prime_dev prime_dev 93 Jan 26 11:09 new2text.py
>execute permissions are lacking (umm, I supose no differences between
>import2.py and new2text.py. But anyway this is what the error message
>indicates). Add them with "chmod u+x [filename]". And make sure this
>script has a proper shebang line within:
>#! /usr/bin/env python
Odd, but you are correct - changed it to execute just for myself and I
am in but at the EOF, that's probably due to it has been run by the exec
command that once run will not repeat.
More information about the Tutor