Re: [Tutor] elif statement

2010-08-13 Thread Sudarshana Banerjee
Hi Alan: Yay! I pressed Enter after the print, and then delete. Which brought the cursor back to the starting position at the beginning of the line, and no more elif syntax errors. This is good to know. Thank you very much. I also took the liberty of checking out your computing website. It is real

Re: [Tutor] Lost in the control flow

2010-08-13 Thread Adam Bark
On 11/08/10 18:14, Eduardo Vieira wrote: On Tue, Aug 10, 2010 at 1:56 PM, Adam Bark wrote: The problem is you don't call make_dict unless there's a "FUEL SURCHARGE" or multiple pins. Also you don't add the first pin to mydict["tracking"] unless there's a "FUEL SURCHARGE". HTH, Adam. _

Re: [Tutor] Learning Python ...Books

2010-08-13 Thread Wayne Werner
On Fri, Aug 13, 2010 at 5:22 AM, Stephen Farthing wrote: > Hi everyone, > > I am going to learn both Python and Ruby so I can see what suits me best. > My ultimate aim is to do some open source cross platform development for my > ham radio and robotics hobbies. One of the key requirements is to be

Re: [Tutor] is it possible to call a setter property during classinstantiation?

2010-08-13 Thread Serdar Tumgoren
> > > > I have a class with an init method that is getting bloated with >> error-checking guard clauses. >> > > Thats very strange. We don't usually have to check types in Python, > it is a dynamic language and we can use duck-typing and exceptions > so we don't usually care too much about types.

Re: [Tutor] Learning Python ...Books

2010-08-13 Thread Bill Allen
On Fri, Aug 13, 2010 at 7:29 AM, Bill Allen wrote: > > > There are several books out there, some for Python 2.x, some for Python > 3.x. None that are quite like K&R in my opinion. > However, here are some resources that may be useful for you, web based but > some providing PDF download so you c

[Tutor] Learning Python ...Books

2010-08-13 Thread Bill Allen
On Fri, Aug 13, 2010 at 5:22 AM, Stephen Farthing wrote: > > What I was wondering is if there is a Python equivalent to "The C > Programming language" by Kernighan and Richie which is the best text on > programming i have ever read. > > Thanks in advance, > > Steve > Steve, There are several boo

Re: [Tutor] Learning Python ...Books

2010-08-13 Thread Joel Goldstick
I like "Learning Python" (O'reilly) Its thicker, but excellent. There isn't really an equivalent to K & R. But, you should go to python.org and read the docs. They are very good On Fri, Aug 13, 2010 at 6:22 AM, Stephen Farthing wrote: > Hi everyone, > > I am going to learn both Python and Ruby

[Tutor] Learning Python ...Books

2010-08-13 Thread Stephen Farthing
Hi everyone, I am going to learn both Python and Ruby so I can see what suits me best. My ultimate aim is to do some open source cross platform development for my ham radio and robotics hobbies. One of the key requirements is to be able to control hardware, via USB, using a GUI. I am an old scho

Re: [Tutor] elif statement

2010-08-13 Thread Alan Gauld
"Sudarshana Banerjee" wrote Could you take a look at this please: x=3 if x==0: print "x is 0" elif x&1==1: SyntaxError: invalid syntax See, the moment I am pressing Enter the >>> is coming.. not ... IDLE doesn't give you a ... prompt it gives you spaces. So you mistake is that ypu are

Re: [Tutor] Callbacks and exception handling

2010-08-13 Thread Alan Gauld
"Pete" wrote One thing though - I noticed that when an exception is raised in the callback function, that exception doesn't actually "show up" in the calling program. Yes it does and Steven has answered that so maybe you are clear now. But just to clarify, when you set a callback there is n

Re: [Tutor] is it possible to call a setter property during classinstantiation?

2010-08-13 Thread Alan Gauld
"Serdar Tumgoren" wrote Does anyone know if it's possible to call a property setter inside of a class's init method? Below is a code sample of what I'm trying to do. Yes and that bit has been answered. But... I have a class with an init method that is getting bloated with error-checking g

Re: [Tutor] string conversion according to the terminal

2010-08-13 Thread Alan Gauld
"ANKUR AGGARWAL" wrote Hey- suppose we have a file name-"my file number" if we want to execute it into the terminal it would be like - my\ file\ number It depends what you are trying to do. so wondering is there any one in the python that change the enter string into the terminal string