Re: [Tutor] key detection

2015-05-06 Thread Steven D'Aprano
On Wed, May 06, 2015 at 03:24:20PM -0700, Jim Mooney Py3.4.3winXP wrote: > On 6 May 2015 at 14:08, Dave Angel wrote: > > > I don't know why you would be expecting to get a utf-8 character for the > > second byte of a function key code. It's an entirely arbitrary byte > > sequence, and not equiva

Re: [Tutor] key detection

2015-05-06 Thread Steven D'Aprano
On Tue, May 05, 2015 at 09:30:12PM -0700, Jim Mooney Py3.4.3winXP wrote: > On 5 May 2015 at 18:32, Steven D'Aprano wrote: > > > https://code.activestate.com/recipes/577977-get-single-keypress/ > > > That only has a stub for Linux, Er, look again, more closely. I happen to know the author ver

Re: [Tutor] key detection

2015-05-06 Thread Jim Mooney Py3.4.3winXP
On 6 May 2015 at 14:08, Dave Angel wrote: > I don't know why you would be expecting to get a utf-8 character for the > second byte of a function key code. It's an entirely arbitrary byte > sequence, and not equivalent to anything in Unicode, encoded or not I just didn't think of accounting for

Re: [Tutor] key detection

2015-05-06 Thread Dave Angel
On 05/06/2015 01:41 PM, Jim Mooney Py3.4.3winXP wrote: from msvcrt import * while True: if kbhit(): key = getch() if key == b'\xe0' or key == b'\000': print('special key follows') key = getch() print(str(key, encoding='utf-8')) #got

Re: [Tutor] key detection

2015-05-06 Thread Jim Mooney Py3.4.3winXP
On 6 May 2015 at 10:41, Jim Mooney Py3.4.3winXP wrote: > I went a further step from the recipes linked to above and got here >> https://pypi.python.org/pypi/readchar > > > I think that's the one that failed for me > Addendum. That only failed in python 3.4. It worked fine in python 2.7 - but I r

Re: [Tutor] key detection

2015-05-06 Thread Jim Mooney Py3.4.3winXP
On 5 May 2015 at 21:51, Mark Lawrence wrote: > On 06/05/2015 05:30, Jim Mooney Py3.4.3winXP wrote: > >> On 5 May 2015 at 18:32, Steven D'Aprano wrote: >> >> https://code.activestate.com/recipes/577977-get-single-keypress/ >>> >> >> >> That only has a stub for Linux, but I found one that does b

[Tutor] doctest: how to test a single function?

2015-05-06 Thread Slater Joseph C , PhD, PE
I'm an admitted newb trying to enter the Python community and use Python significantly (versus occassionally). dockets seems to be much more powerful than I can figure out how to tap. I have a function inside a file that's an embedded test that (currently) works fine. However, the package has

Re: [Tutor] Fwd: Re: Adding consecutive numbers

2015-05-06 Thread Alan Gauld
On 06/05/15 15:01, Dave Angel wrote: def adding_all(x): total = 0 for num in x: total +=num return total Good function. Except for the fact that the built-in sum() function does the same thing with a lot less typing... -- Alan G Author of the Learn to Program web si

Re: [Tutor] Fwd: Re: Adding consecutive numbers

2015-05-06 Thread Whom Isac
Thanks, Steven. I think you are right about those mistake. But you could tell that the code was incomplete so the interact() was not defined. I have updated some parts (basically writing from the scratch). I am busy with a new project and learning how to create GUI app in python, although there are

Re: [Tutor] Fwd: Re: Adding consecutive numbers

2015-05-06 Thread Dave Angel
On 05/06/2015 07:51 AM, Alan Gauld wrote: Please use ReplyAll to include the list members. Forwarded Message Subject: Re: [Tutor] Adding consecutive numbers Date: Wed, 6 May 2015 21:13:15 +1000 From: Whom Isac To: Alan Gauld Thanks for the reply. I am sorr

Re: [Tutor] key detection

2015-05-06 Thread Dave Angel
On 05/06/2015 12:02 AM, Jim Mooney Py3.4.3winXP wrote: actually worked in windows instead of using their awful screen copy. What a surprise: Many people don't realize that you can turn on a better screen copy feature for the CMD window (DOS box) in Windows. I've given up Windows, and no lon

Re: [Tutor] Fwd: Re: Adding consecutive numbers

2015-05-06 Thread Mark Lawrence
Forwarded Message Subject: Re: [Tutor] Adding consecutive numbers Date: Wed, 6 May 2015 21:13:15 +1000 From: Whom Isac To: Alan Gauld I am actually using the latest version of python (3.5) in windows 7 operating system. Why are you using a version of Python

[Tutor] Fwd: Re: Adding consecutive numbers

2015-05-06 Thread Alan Gauld
Please use ReplyAll to include the list members. Forwarded Message Subject:Re: [Tutor] Adding consecutive numbers Date: Wed, 6 May 2015 21:13:15 +1000 From: Whom Isac To: Alan Gauld Thanks for the reply. I am sorry that I did not notice the mail. I am actu

Re: [Tutor] Having Unusual results

2015-05-06 Thread Jag Sherrington
Excellent all working good, thank you. Regards, Jag BraveArt Multimedia On Saturday, 2 May 2015, 22:28, Dave Angel wrote: On 05/02/2015 04:36 AM, Peter Otten wrote: > Jag Sherrington wrote: > With that the calculation becomes > buns = 20 package_size = 8 whole_packa