Re: [Tutor] Having trouble figuring out bug

2013-02-13 Thread richard kappler
On Wed, Feb 13, 2013 at 6:56 PM, Steven D'Aprano wrote: > On 14/02/13 10:14, richard kappler wrote: > >> I have tried to run the Google speech recognition code found here: >> https://github.com/jeysonmc/**python-google-speech-scripts/** >> blob/master/stt_google.py

Re: [Tutor] Python Lover

2013-02-13 Thread DoanVietTrungAtGmail
I am also learning and have found it useful to learn from David Beazley's "Python In Action", parts 1 and 2. Part 2 is tough for me because I don't know other languages nor systems programming, but may be OK for you Brajesh. The slidepacks are at http://www.slideshare.net/dabeaz/presentations

Re: [Tutor] Having trouble figuring out bug

2013-02-13 Thread richard kappler
> See that KeyboardInterrupt line? That was missing from your first post. > > You get that because you have hit Ctrl-C, which is Python's way of halting > the running code (if possible). If you don't want this exception, then > don't hit Ctrl-C. > > Which of course brings you to a dilemma -- the so

Re: [Tutor] Having trouble figuring out bug

2013-02-13 Thread Steven D'Aprano
On 14/02/13 11:16, richard kappler wrote: On Wed, Feb 13, 2013 at 6:56 PM, Steven D'Apranowrote: On 14/02/13 10:14, richard kappler wrote: I have tried to run the Google speech recognition code found here: https://github.com/jeysonmc/**python-google-speech-scripts/** blob/master/stt_google.py

Re: [Tutor] Having trouble figuring out bug

2013-02-13 Thread Steven D'Aprano
On 14/02/13 10:14, richard kappler wrote: I have tried to run the Google speech recognition code found here: https://github.com/jeysonmc/python-google-speech-scripts/blob/master/stt_google.py I am getting the following traceback: Traceback (most recent call last): File "", line 1, in File

[Tutor] Having trouble figuring out bug

2013-02-13 Thread richard kappler
I have tried to run the Google speech recognition code found here: https://github.com/jeysonmc/python-google-speech-scripts/blob/master/stt_google.py I am getting the following traceback: Traceback (most recent call last): File "", line 1, in File "GoogSTT.py", line 43, in listen_for_speech

Re: [Tutor] Python Lover

2013-02-13 Thread Prasad, Ramit
Brajesh wrote: > Hi , > > I have just subscribed mailing list to learn python. I am programming in > java for nearly 8 months, I have developed a strong love towards python > and want to learn and start making the best use of it. I want to know > where to from as i know JAVA already so where to st

Re: [Tutor] "Strange" behaviour of list comprehension

2013-02-13 Thread Hugo Arts
On Wed, Feb 13, 2013 at 10:07 PM, Mahadevan, Anand wrote: > Thanks for the good explanation, Hugo. Not sure of the protocol for > replying in this forum, when I clicked on reply it filled your id in. > Glad I could be of help :) For future reference, it's generally considered politest to send a

Re: [Tutor] "Strange" behaviour of list comprehension

2013-02-13 Thread eryksun
On Wed, Feb 13, 2013 at 9:17 AM, Hugo Arts wrote: > To be more precise, the comma at the end is part of a tuple (you can omit > parentheses of a tuple in many cases). This makes the final for loop iterate > over the tuple (range(y, 10), x + y == z). You'll notice that this only > works if the vari

Re: [Tutor] Additional help

2013-02-13 Thread Prasad, Ramit
Ahmet Can KEPENEK wrote: > Hello, > I used regular expression module of python. I checked binary and denary > numbers. If input is invalid i > ask again. I edited your code. Code is below follow as . > [snip] >     if re.match("^[0-1]*$", binary): >     if re.match("^[0-9]*$", denary2): [

Re: [Tutor] Binary Addition

2013-02-13 Thread bob gailer
On 2/13/2013 2:13 PM, Ghadir Ghasemi wrote: Hi guys can you tell me what is wrong with this code?. It says unexpected indent and the bottom of the code everytime I run it. Thank you on=True while on == True: def eight_digit_binary1(message): response1 = input(message) while

Re: [Tutor] associating two objects without ORM and processing a text file

2013-02-13 Thread Alan Gauld
On 13/02/13 19:14, neubyr wrote: I am not sure how to save an object in memory to a file before exiting the program. Any examples or related documentation links would be really helpful. I am guessing it would be using some kind of before teardown method, but not sure about it. Any help? If usi

Re: [Tutor] Binary Addition

2013-02-13 Thread bob gailer
On 2/13/2013 2:13 PM, Ghadir Ghasemi wrote: Hi guys can you tell me what is wrong with this code?. It says unexpected indent and the bottom of the code everytime I run it. Thank you Please post the entire traceback - there is valuable information there. Without that we have to go on a time con

Re: [Tutor] Binary Addition

2013-02-13 Thread Alan Gauld
On 13/02/13 19:13, Ghadir Ghasemi wrote: Hi guys can you tell me what is wrong with this code?. Quite a few things. Your try lines don't have matching excepts You have a function definitions in the middle that have indentation errors. eg. def eight_digit_binary1(message): r

Re: [Tutor] Binary Addition

2013-02-13 Thread Mark Lawrence
On 13/02/2013 19:13, Ghadir Ghasemi wrote: Hi guys can you tell me what is wrong with this code?. It says unexpected indent and the bottom of the code everytime I run it. Thank you on=True while on == True: def eight_digit_binary1(message): response1 = input(message) while

[Tutor] Binary Addition

2013-02-13 Thread Ghadir Ghasemi
Hi guys can you tell me what is wrong with this code?. It says unexpected indent and the bottom of the code everytime I run it. Thank you on=True while on == True: def eight_digit_binary1(message): response1 = input(message) while len(response1) > 8: response1 = input(me

Re: [Tutor] associating two objects without ORM and processing a text file

2013-02-13 Thread neubyr
On Tue, Feb 12, 2013 at 4:56 PM, Steven D'Aprano wrote: > On 13/02/13 04:32, neubyr wrote: > > I am not following your comment on opening books file twice in >> list_by_author method. I have opened it only once and then reading each >> line while checking for a regex match. Am I missing something

Re: [Tutor] Python Lover

2013-02-13 Thread Joel Goldstick
On Wed, Feb 13, 2013 at 10:23 AM, Brajesh wrote: > Hi , > > I have just subscribed mailing list to learn python. I am programming in > java for nearly 8 months, I have developed a strong love towards python and > want to learn and start making the best use of it. I want to know where to > from as

[Tutor] Python Lover

2013-02-13 Thread Brajesh
Hi , I have just subscribed mailing list to learn python. I am programming in java for nearly 8 months, I have developed a strong love towards python and want to learn and start making the best use of it. I want to know where to from as i know JAVA already so where to start from. Regards Bra

Re: [Tutor] "Strange" behaviour of list comprehension

2013-02-13 Thread Mark Lawrence
On 13/02/2013 14:17, Hugo Arts wrote: To be more precise, the comma at the end is part of a tuple (you can omit parentheses of a tuple in many cases). Parantheses are not part of a tuple except in special cases, see http://docs.python.org/2/tutorial/datastructures.html#tuples-and-sequences

Re: [Tutor] "Strange" behaviour of list comprehension

2013-02-13 Thread Hugo Arts
On Wed, Feb 13, 2013 at 2:45 PM, Mahadevan, Anand wrote: > I'm playing around with list comprehension and in IDLE typed this in. I > actually wanted it to return all tuples satisfying the condition where z is > the sum of x and y. I kind of got mixed up with the syntax, hence I put a > comma in t

Re: [Tutor] "Strange" behaviour of list comprehension

2013-02-13 Thread Peter Otten
Mahadevan, Anand wrote: > I'm playing around with list comprehension and in IDLE typed this in. I > actually wanted it to return all tuples satisfying the condition where z > is the sum of x and y. I kind of got mixed up with the syntax, hence I put > a comma in there instead of an "if". I'd lik

Re: [Tutor] "Strange" behaviour of list comprehension

2013-02-13 Thread Oscar Benjamin
On 13 February 2013 13:45, Mahadevan, Anand wrote: > I'm playing around with list comprehension and in IDLE typed this in. I > actually wanted it to return all tuples satisfying the condition where z is > the sum of x and y. I kind of got mixed up with the syntax, hence I put a > comma in ther

[Tutor] "Strange" behaviour of list comprehension

2013-02-13 Thread Mahadevan, Anand
I'm playing around with list comprehension and in IDLE typed this in. I actually wanted it to return all tuples satisfying the condition where z is the sum of x and y. I kind of got mixed up with the syntax, hence I put a comma in there instead of an "if". I'd like some assistance understandin