PDA

View Full Version : [SOLVED] Python Lesson 1 Question



WannabeFantasma
February 16th, 2010, 10:09 PM
Hi all,
I wanted to start to learn how to program in Python when I saw it in Full Circle Magazine(ISSUE27)

But I don't get the line:


Before we
can run the program, we need
to set it to be executable. Do
this by typing

chmod +x hello.py
in the folder where you saved
your python file. Now let's run
the program.

screenshot of the page (http://img171.imageshack.us/img171/5056/python1.jpg)

does anyone know?


(and yeh this is like really basic but i just want to learn some programming (or something)...)

oldfred
February 16th, 2010, 10:47 PM
To run the file as a program you have to make it executable.

you can do this to see what chmod is.:
man chmod

and to see read, write and execute permissions of files.
ls -l

You can also run it

python hello.py

WannabeFantasma
February 16th, 2010, 11:26 PM
Yay i got it executed!

All i got was



Hello. I am a python program.
What is your name?

I type my name press enter and nothing :D

so not good yet :D
but atleast i know how to execute! :D (atleast if it has to open in a therminal? :D )

Tony Flury
February 17th, 2010, 02:00 PM
You might find this would be answered in Programming Talk - although, which tends to be very good for general programming questions