[sf-lug] [PYCLASS] Still on exercise 2.1

Alex Kleider a_kleider at yahoo.com
Sat Oct 4 14:55:51 PDT 2008




--- On Fri, 10/3/08, Christian Einfeldt <einfeldt at gmail.com> wrote:

> I am still trying to get my assignment 2.1 to run.  Here is
> my script.
> 
> #! /usr/bin/python
> 5
> x = 5
> x + 1
> 
> and here is my attempt to execute it.
> 
> cje at rb:~$ cd Desktop
> cje at rb:~/Desktop$ python asheesh_homework_exercise_2_1.py
> cje at rb:~/Desktop$
> 
> In other words, it just returns me to a dollar prompt.  I
> checked the path
> to python and it is right.  The script should be doing
> this, which is how
> the code executes in the interpreter:
> 
> cje at rb:~/Desktop$ python
> Python 2.5.1 (r251:54863, Jul 31 2008, 23:17:40)
> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
> on linux2
> Type "help", "copyright",
> "credits" or "license" for more
> information.
> >>> 5
> 5
> >>> x = 5
> >>> x + 1
> 6
> >>>
> 
Christian, fyi
the first line in your script (if you set execute permission) allows you to call it by simply entering $ ./<name of file>
Without it and without execute permission you can still execute it with 
the syntax $ python <name of file>




      




More information about the sf-lug mailing list