PDA

View Full Version : Anjuta IDE - Really Simple Python Question



FieldDoc
July 21st, 2010, 06:31 PM
I'm new to Linux, Python and the Anjuta IDE.

I have created a new file called hello.py. This is the contents of that file:


#!/usr/bin/env python
print "Hello World!"

All I want to do is run this in the terminal. I go to Run > Execute but I get the following error message:


Program 'home/joe/Programming/Python//hello.py' does not have execution permission

How do I get this really simple program to run?

Thanks,

RiceMonster
July 21st, 2010, 06:32 PM
chmod +x /home/joe/Programming/Python/hello.py

Åtta
July 21st, 2010, 06:35 PM
Or if you prefer to do it graphically, just right click it, "Properties" → "Permissions" and tick the box saying "Allow this file to be executed" (or something like that).

FieldDoc
July 21st, 2010, 07:55 PM
chmod +x /home/joe/Programming/Python/hello.py

Thanks.

When I double click it - I get a dialog asking me if I want to run it in the Terminal or Run it. When I click either option - nothing really seems to happen. I'd have thought a Terminal window would open?

RiceMonster
July 21st, 2010, 08:12 PM
Thanks.

When I double click it - I get a dialog asking me if I want to run it in the Terminal or Run it. When I click either option - nothing really seems to happen. I'd have thought a Terminal window would open?

try executing it directly from a terminal to see the output. First, cd to the directory it's in:

cd ~/Programming/Python/

Then, execute it by doing either of the below:

python hello.py
./hello.py

FieldDoc
July 21st, 2010, 08:22 PM
try executing it directly from a terminal to see the output. First, cd to the directory it's in:

cd ~/Programming/Python/

Then, execute it by doing either of the below:

python hello.py
./hello.py

Thanks.

cgroza
October 24th, 2010, 08:37 PM
Bringing this alive. Is there a plugin for python support for anjuta?