Re: [Tutor] Issues In Terminal

2010-09-28 Thread Wayne Werner
On Tue, Sep 28, 2010 at 5:02 AM, Alan Gauld wrote: > > "Marc Tompkins" wrote > > > > The parentheses are optional in 2.6, mandatory in 3. In 2.6, print and >> print() are alternate ways to invoke the print statement >> > > Not strictly true. They often give the same results but not always, > se

Re: [Tutor] Issues In Terminal

2010-09-28 Thread Alan Gauld
"Marc Tompkins" wrote The parentheses are optional in 2.6, mandatory in 3. In 2.6, print and print() are alternate ways to invoke the print statement Not strictly true. They often give the same results but not always, see a recent thread on this. In particular print ('a','b') is quite

Re: [Tutor] Issues In Terminal

2010-09-26 Thread Dave Angel
On 2:59 PM, Bill DeBroglie wrote: No, I meant that you should edit your .py file and add #!/usr/bin/env python as the first line, THEN try to run it. BINGO! Right now what's happening is that you're handing a line of Python script to the shell and asking it to run it; the shell is tellin

Re: [Tutor] Issues In Terminal

2010-09-26 Thread Steven D'Aprano
On Mon, 27 Sep 2010 08:37:08 am Bill DeBroglie wrote: > > No, I meant that you should edit your .py file and add > > #!/usr/bin/env python > > as the first line, THEN try to run it. > > BINGO! > > > Right now what's happening is that you're handing a line of Python > >   script to the shell and ask

Re: [Tutor] Issues In Terminal

2010-09-26 Thread Bill DeBroglie
On Sep 26, 2010, at 6:29 PM, Marc Tompkins wrote: On Sun, Sep 26, 2010 at 3:24 PM, Bill DeBroglie > wrote: Is this what you mean? matthew-parrillas-macbook:Dawson_Book matthewparrilla$ #!/usr/bin/ env python matthew-parrillas-macbook:Dawson_Book matthewparrilla$ ./chapter_2.py ./c

Re: [Tutor] Issues In Terminal

2010-09-26 Thread Marc Tompkins
On Sun, Sep 26, 2010 at 3:24 PM, Bill DeBroglie wrote: > > Is this what you mean? > > matthew-parrillas-macbook:Dawson_Book matthewparrilla$ #!/usr/bin/env > python > matthew-parrillas-macbook:Dawson_Book matthewparrilla$ ./chapter_2.py > ./chapter_2.py: line 1: syntax error near unexpected token

Re: [Tutor] Issues In Terminal

2010-09-26 Thread Bill DeBroglie
On Sep 26, 2010, at 6:18 PM, Marc Tompkins wrote: On Sun, Sep 26, 2010 at 3:04 PM, David Hutto wrote: > Pretty sure it's the parentheses, but I'm not an expert. In python 3 you use > print(), in 2.6 you either use import from __futur__ or print "string here". I mean __future__ . The pa

Re: [Tutor] Issues In Terminal

2010-09-26 Thread Bill DeBroglie
On Sep 26, 2010, at 6:06 PM, Marc Tompkins wrote: On Sun, Sep 26, 2010 at 2:55 PM, Bill DeBroglie > wrote: Which is great, but when I try and run the same code in the Terminal by calling a program I've written (print("hello world") again) I get the following: matthews-macbook:Dawson

Re: [Tutor] Issues In Terminal

2010-09-26 Thread Steven D'Aprano
On Mon, 27 Sep 2010 07:55:40 am Bill DeBroglie wrote: [...] > Which is great, but when I try and run the same code in the Terminal > by calling a program I've written (print("hello world") again) I get > the following: How do you call the program? At the shell prompt, if you call: python name_of

Re: [Tutor] Issues In Terminal

2010-09-26 Thread Marc Tompkins
On Sun, Sep 26, 2010 at 3:04 PM, David Hutto wrote: > > Pretty sure it's the parentheses, but I'm not an expert. In python 3 you > use > > print(), in 2.6 you either use import from __futur__ or print "string > here". > > I mean __future__ . > The parentheses are optional in 2.6, mandatory in 3.

Re: [Tutor] Issues In Terminal

2010-09-26 Thread Marc Tompkins
On Sun, Sep 26, 2010 at 2:55 PM, Bill DeBroglie wrote: > Which is great, but when I try and run the same code in the Terminal by > calling a program I've written (print("hello world") again) I get the > following: > >matthews-macbook:Dawson_Book matthewparrilla$ ./chapter_2.py >./c

Re: [Tutor] Issues In Terminal

2010-09-26 Thread David Hutto
On Sun, Sep 26, 2010 at 6:03 PM, David Hutto wrote: > On Sun, Sep 26, 2010 at 5:55 PM, Bill DeBroglie > wrote: >> Hello all, >> >> Totally new to this stuff and community so I very much appreciate the help >> and apologize in advance for asking what might be a stupid question... Oh, >> and I'm ne

Re: [Tutor] Issues In Terminal

2010-09-26 Thread David Hutto
On Sun, Sep 26, 2010 at 5:55 PM, Bill DeBroglie wrote: > Hello all, > > Totally new to this stuff and community so I very much appreciate the help > and apologize in advance for asking what might be a stupid question... Oh, > and I'm new to the lingo too!! > > I'm having issues running Python in T

[Tutor] Issues In Terminal

2010-09-26 Thread Bill DeBroglie
Hello all, Totally new to this stuff and community so I very much appreciate the help and apologize in advance for asking what might be a stupid question... Oh, and I'm new to the lingo too!! I'm having issues running Python in Terminal. When I run code through the interpreter I get: