Re: [Tutor] Help with making emacs work with python syntax checking?

2011-07-06 Thread col speed
On 5 July 2011 07:15,  wrote:

> I second this.
>
> I have a second harddrive with Mint on it. Ithought it might be fun to
> learn emacs. On windows I've been using eclipse for like 6 to 12 months or
> however long ago I started.
>
> I tried emacs for about two seconds and was like, uh no thanks. Downloaded
> and set up eclipse and I'm still happy. Other than it took too long to set
> up in mint
>
> Bonus is I can use it django as well.
>
>
> Sent from my Verizon Wireless BlackBerry
>
> -Original Message-
> From: "Alan Gauld" 
> Sender: tutor-bounces+eire1130=gmail@python.org
> Date: Mon, 4 Jul 2011 23:59:48
> To: 
> Subject: Re: [Tutor] Help with making emacs work with python syntax
> checking?
>
> "Tidal Espeon"  wrote
>
> >I need help with installing this setup on my emacs:
>
> Why do you want this? Are you already an emacs
> user? If so then fine, go ahead. But if you do not
> already use emacs, lerarning it will be a big effort.
> emacs is a big, powerful tool and once you know
> it you can use it for almost everything. But its not
> something you can learn to use quickly.
>
> > The problem is that I have no clue how to
> > access any .emacs file or .emacs.d
>
> Which strongly suggests you are not n emacs regular.
> If you were you would be editing .emacs regularly!
>
> > the IDLE just doesn't cut it for me.
>
> There are lots of other development enmvirobnments around.
> If you are a typical GUI user, which it sounds as if you are,
> then a tool liker Eclipse, (or maybe Blackadder or .Wing or SPE)
> might be more appropriate. They are powerful but GUI
> oriented rather than command oriented.
>
> Frankly if you are not already an emacs user, or unless
> you want to make emacs you standard environment
> in the future and will spend the time changing your
> computing habits to suit emacs, I'd give up and find
> a more GUI friendly tool set!
>
> And I say that as someone who is an emacs (and vim) user!
> emacs is a powerful tool and a great programmer's
> environment, but it's not for the faint hearted.
>
> HTH,
>
> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>

To find hidden files on Linux(well Ubuntu anyway), navigate to the directory
and press ctrl+H. Open and change at your peril!

--
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] broken script - curiouser and curiouser

2011-07-06 Thread Lisi
Thanks very much Martin.  I did "solve" the problem after you kindly emailed - 
but the solution has puzzled me more that the original problem.

On Tuesday 05 July 2011 23:23:41 Martin wrote:
>  : lisi@Tux:~/Python/LearnPythonTheHardWay$ python ex26.py
>  :   File "ex26.py", line 10
>  : def print_first_word(words)
>  :   ^
>  : SyntaxError: invalid syntax
>  : lisi@Tux:~/Python/LearnPythonTheHardWay$
>
> Look at the error.  Look at the error carefully.
>
> Look at the definitions of your other functions
>
> Compare.  What is different?

I could see nothing that was different.

>   do you see the colon?

Yes - it was one of the first things I looked for when the error came up (that 
and check that the brackets were right).  It was there in what seemed to me 
to be the right position.
>  
> def silly_function(args):
>
> Curiously, the sample that you pasted above has the required colon
> at the end of the line which starts the function definition.
>
>  : def print_first_word(words):
>  : """Prints the first word after popping it off."""
>  : word=words.pop(0)
>  : print word
>
> I have heard people express frustration many times about how a
> program(ming language) or "the computer" did not understand
> something because the thing was 'missing a damned semicolon'.

 I know that the smallest difference matters when dealing with a computer but 
could - and can - find none.

> Try again, keep with it, and recognize that these beasties are
> awfully particular in what they accept.  And, for good reason.

I have no difficulty with the fact that computers are literal minded.  They 
are after all, machines.  But "try again" was obviously great advice, and you 
had given me the push I needed to try again when I had given up.  

In the end, having tried absolutely everything else I could think of, and 
given that the error arose at the closing bracket at the end of line 10, I 
tried the only thing I could remotely think of that I hadn't tried and put a 
space in between the second bracket and the colon - and the wretched thing 
ran.  So I altered line six in the same way - and that still ran.  So line 
six will run either with or without the space.  I then typed the next 2 
sections in, and they ran, like line 6, either with or without the space.

So line 10 needs a space and the other sections are happy either with or 
without.  And they all have """ at the beginning of the next line.

You could obviously see something wrong that I had continued, and continue, to 
miss, and I have still not found it.  Hitting on the "right" solution almost 
by serendipity doesn't really count as seeing something wrong!!

> Best of luck, Lisi,

Thanks again very much Martin.  You really encouraged me.  

I am obviously not going to get any further now, I am so bogged down in the 
whole thing.  So I think that I may need to pass on and come back to it 
later.

Lisi
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] broken script - curiouser and curiouser

2011-07-06 Thread Alan Gauld


"Lisi"  wrote 


 :   File "ex26.py", line 10
 : def print_first_word(words)
 :   ^
 : SyntaxError: invalid syntax
 : lisi@Tux:~/Python/LearnPythonTheHardWay$

Look at the error.  Look at the error carefully.


I could see nothing that was different.


The error report says you had no colon in your code.
Python couldn't see it...

Are you sutre you didn't add it before posting but 
after running the code?


Or are you testing it by impotrting a module? 
In that case the interpreter may still be using 
the old version because you haven't reloaded 
the updated version?


Yes - it was one of the first things I looked for when 
the error came up (that and check that the brackets 
were right).  It was there in what seemed to me 
to be the right position.


In that case I suspect the module theory.
How are you running the code?

In the end, having tried absolutely everything else 
I could think of, and given that the error arose at 
the closing bracket at the end of line 10, I 
tried the only thing I could remotely think of that 
I hadn't tried and put a space in between the 
second bracket and the colon - and the wretched thing 
ran.  


As you know that shouldn't have made any difference.
Did you try going back and removing the space again 
and see if the error came back?


You could obviously see something wrong 


The posted error report had no colon.

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor