Permission Denied

AlbaClause you at cogeco.ca
Sun Aug 20 00:51:18 EDT 2006


hiaips wrote:

> 
> Tom Strickland wrote:
>> Hopefully this is a simple question. I've started to program in Python
>> after an absence of about a year, so I'm very rusty. I wrote a short
>> program and tried to run it using Python2.4 in Linux. I keep getting
>> "permission denied" messages after entering the path to the program. I
>> switched to the root directory and tried again, but got the same
>> result.I ran a very similar program earlier and it ran fine.
>>
>> What am I doing wrong? The program is:
>>
>>
>> #!/usr/bin/python2.4
>> i=1
>> while i<10000:
>>     print 'step 1',i
>>     i+=1
>> raw_input()
>> print 'step 2'
>> 
>> 
>> Thank you.
>> 
>> Tom
> 
> 
> Is your script executable?

That's the problem I had when I wrote my first Python script.  I wrote it
using vi, and vi doesn't save files with the executable flag set.  A simple
'chmod 755 script.py' fixed that right up.

Then, to execute the file from from the shell prompt, I had to create a
'bin' directory in my home folder, cuz I didn't want to litter
my /usr/local/bin folder with useless Python scripts.  (Useless because I
wrote them to learn the language and for no other practical purpose.)  Of
course, I had to uncomment a line or two in my .bashrc file too.

Hey, what do I know?  I'm as new to this as virgins are to...  Well, you get
the idea.  :-p

 
-- 
--
There are several things that I will never be:
  *  I will never be attracted to females.
  *  I will never enjoy the company of others.
Exactly how these realities bode for my enemy, is not of my concern.




More information about the Python-list mailing list