Re: Drowning in a teacup?

2016-04-01 Thread Vito De Tullio
Michael Selik wrote: >> > I need to scan a list of strings. If one of the elements matches the >> > beginning of a search keyword, that element needs to snap to the front >> > of the list. >> >> I know this post regards the function passing, but, on you specific >> problem, >> can't you just ... s

Re: Drowning in a teacup?

2016-04-01 Thread Michael Selik
On Sat, Apr 2, 2016, 1:46 AM Vito De Tullio wrote: > Fillmore wrote: > > > I need to scan a list of strings. If one of the elements matches the > > beginning of a search keyword, that element needs to snap to the front > > of the list. > > I know this post regards the function passing, but, on yo

Re: [beginner] What's wrong?

2016-04-01 Thread William Ray Wing
> On Apr 1, 2016, at 6:57 PM, Mark Lawrence via Python-list > wrote: > >> On 01/04/2016 23:44, sohcahto...@gmail.com wrote: >>> On Friday, April 1, 2016 at 3:10:51 PM UTC-7, Michael Okuntsov wrote: >>> Nevermind. for j in range(1,8) should be for j in range(8). >> >> I can't tell you how many

Re: Drowning in a teacup?

2016-04-01 Thread Vito De Tullio
Fillmore wrote: > I need to scan a list of strings. If one of the elements matches the > beginning of a search keyword, that element needs to snap to the front > of the list. I know this post regards the function passing, but, on you specific problem, can't you just ... sort the list with a cust

Re: [beginner] What's wrong?

2016-04-01 Thread Michael Selik
On Sat, Apr 2, 2016, 12:28 AM Random832 wrote: > On Fri, Apr 1, 2016, at 19:29, Michael Selik wrote: > > Humans have always had trouble with this, in many contexts. I remember > > being annoyed at folks saying the year 2000 was the first year of the new > > millennium, rather than 2001. They'd fo

Re: [beginner] What's wrong?

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 19:29, Michael Selik wrote: > Humans have always had trouble with this, in many contexts. I remember > being annoyed at folks saying the year 2000 was the first year of the new > millennium, rather than 2001. They'd forgotten the Gregorian calendar > starts from AD 1. Natur

Re: Drowning in a teacup?

2016-04-01 Thread Fillmore
On 04/01/2016 04:27 PM, Fillmore wrote: notorious pass by reference vs pass by value biting me in the backside here. Proceeding in order. Many thanks to all of those who replied! -- https://mail.python.org/mailman/listinfo/python-list

Django Channels examples

2016-04-01 Thread justin walters
To all of my Web developer bros and broettes, You all should check out this github repo: https://github.com/andrewgodwin/channels-examples This is not my repo or my work. Channels is a package for Django that allows Django to work more easily with websockets through an asgi interface. The Django

Re: pow() & modulo QUESTION

2016-04-01 Thread MRAB
On 2016-04-02 00:08, vaulhau...@gmail.com wrote: Having trouble performing the pow() function with real numbers. I want to also take a modulo value Weirdly, this works fine ; pow(2,6000,400) = 176 However, this returns an error ; pow(1.4142, 6000, 400) I have tried also the math.pow() f

Introduction

2016-04-01 Thread Dale Marvin
I just sent my first post, been using python for about 12 years to automate media production tasks. Lately I've been adding testing (Thanks Ned Batchelder: ), and documentation with Sphinx/rst. Thanks Dale Marvin digital OutPost -- https://mail.pyt

Re: Grab metadata from images and save to file, batch mode

2016-04-01 Thread Dale Marvin
On 4/1/16 2:20 PM, accessnew...@gmail.com wrote: I have a directory (and sub-directories) full of images that I want to cycle through and grab certain metadata values and save those values to a single row in a cvs file. I would like to tack on the full path name to the row as a separate value.

Re: [beginner] What's wrong?

2016-04-01 Thread Michael Selik
Humans have always had trouble with this, in many contexts. I remember being annoyed at folks saying the year 2000 was the first year of the new millennium, rather than 2001. They'd forgotten the Gregorian calendar starts from AD 1. On Fri, Apr 1, 2016, 6:58 PM Mark Lawrence via Python-list < pyth

pow() & modulo QUESTION

2016-04-01 Thread vaulhausen
Having trouble performing the pow() function with real numbers. I want to also take a modulo value Weirdly, this works fine ; pow(2,6000,400) = 176 However, this returns an error ; pow(1.4142, 6000, 400) I have tried also the math.pow() function but it doesnt work either. can any one

Re: [beginner] What's wrong?

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 23:44, sohcahto...@gmail.com wrote: On Friday, April 1, 2016 at 3:10:51 PM UTC-7, Michael Okuntsov wrote: Nevermind. for j in range(1,8) should be for j in range(8). I can't tell you how many times I've gotten bit in the ass with that off-by-one mistake whenever I use a range th

Re: install open cv on windows 10 and python 3.5

2016-04-01 Thread MRAB
On 2016-04-01 22:37, Xristos Xristoou wrote: Τη Παρασκευή, 1 Απριλίου 2016 - 1:56:52 μ.μ. UTC+3, ο χρήστης Xristos Xristoou έγραψε: hello, i have windows 10 and python 3.5 and i want to use open cv but i think so opencv work only on python 2.7 ? and i install this http://www.lfd.uci.edu/~gohlk

Re: Drowning in a teacup?

2016-04-01 Thread Steven D'Aprano
On Sat, 2 Apr 2016 07:27 am, Fillmore wrote: > > notorious pass by reference vs pass by value biting me in the backside > here. Proceeding in order. Python is NEITHER pass by reference nor pass by value. Please read this: http://import-that.dreamwidth.org/1130.html before asking any additiona

Re: [beginner] What's wrong?

2016-04-01 Thread sohcahtoa82
On Friday, April 1, 2016 at 3:10:51 PM UTC-7, Michael Okuntsov wrote: > Nevermind. for j in range(1,8) should be for j in range(8). I can't tell you how many times I've gotten bit in the ass with that off-by-one mistake whenever I use a range that doesn't start at zero. I know that if I want to

Re: Strange range

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 21:44, Marko Rauhamaa wrote: Rob Gaddi : Marko Rauhamaa wrote: There's a bit of a cognitive dissonance between iterables and iterators. On the one hand, they behave identically in many contexts. On the other hand, the distinction is crucial in some special cases. You're missing

Re: [beginner] What's wrong?

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 23:10, Michael Okuntsov wrote: Nevermind. for j in range(1,8) should be for j in range(8). Thank you for your correction, we in Python land greatly appreciate such things :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language

Re: Drowning in a teacup?

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 21:27, Fillmore wrote: notorious pass by reference vs pass by value biting me in the backside here. Proceeding in order. It is pass by object. By definition your following analysis is wrong. To my knowledge this has been discussed at least twice a year for the past 15 years.

Re: [beginner] What's wrong?

2016-04-01 Thread Michael Okuntsov
Nevermind. for j in range(1,8) should be for j in range(8). -- https://mail.python.org/mailman/listinfo/python-list

[beginner] What's wrong?

2016-04-01 Thread Michael Okuntsov
Hello, I have a Pascal code for some hash function. I've tried to rewrite it on Python but it doesn't give the right value (which is 32202). Please tell me where is the error. Thanks. ** Pascal program ** Program K_S; Var ST: String;

Re: install open cv on windows 10 and python 3.5

2016-04-01 Thread Xristos Xristoou
Τη Παρασκευή, 1 Απριλίου 2016 - 1:56:52 μ.μ. UTC+3, ο χρήστης Xristos Xristoou έγραψε: > hello, > > i have windows 10 and python 3.5 and i want to use > open cv but i think so opencv work only on python 2.7 ? > and i install this http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv > but not work ag

Grab metadata from images and save to file, batch mode

2016-04-01 Thread accessnewbie
I have a directory (and sub-directories) full of images that I want to cycle through and grab certain metadata values and save those values to a single row in a cvs file. I would like to tack on the full path name to the row as a separate value. Folder C:\Images\Family Brother.jpg Sister.jpg Mo

Re: Strange range

2016-04-01 Thread Terry Reedy
On 4/1/2016 4:14 PM, Marko Rauhamaa wrote: There's a bit of a cognitive dissonance between iterables and iterators. On the one hand, they behave identically in many contexts. Because iterators *are* (a proper subset of) iterables This goes back to pre-iterator days when for-loops worked on s

Re: Drowning in a teacup?

2016-04-01 Thread Ian Kelly
On Fri, Apr 1, 2016 at 3:10 PM, Chris Kaynor wrote: > The overall algorithm is O(n^2), as its doing a O(n) operation in a O(n) > loop: Depends on whether the OP expects to find only one match or potentially multiple matches in the list. E did say "if one of the elements matches". If there are on

Re: Drowning in a teacup?

2016-04-01 Thread Ethan Furman
On 04/01/2016 01:27 PM, Fillmore wrote: notorious pass by reference vs pass by value biting me in the backside here. Proceeding in order. It's only notorious for folks that don't understand that Python uses neither. It also doesn't help when folks don't understand how name-binding works.

Re: Drowning in a teacup?

2016-04-01 Thread Chris Kaynor
On Fri, Apr 1, 2016 at 1:52 PM, Ian Kelly wrote: > On Fri, Apr 1, 2016 at 2:39 PM, Rob Gaddi > wrote: > > Fillmore wrote: > >> Nope, wrong! contrary to what I thought I had understood about how > >> parameters are passed in Python, the function is acting on a copy(!) and > >> my original list is

writing to command line thru python gui

2016-04-01 Thread A. ElKader
I posted this question, no reply : Any advice : http://unix.stackexchange.com/questions/273573/write-to-terminal-in-tkinter-gui -- https://mail.python.org/mailman/listinfo/python-list

Re: extract rar

2016-04-01 Thread Jianling Fan
Thanks, but the problem is that I am not allowed to install any software in my office PC, even free software. Normally, I use zip files but this time I need to extract a rar file. I don't like to go to IT guys because it takes time. That's why I am looking for an alternative way without installing

Re: install open cv on windows 10 and python 3.5

2016-04-01 Thread Terry Reedy
On 4/1/2016 4:38 PM, saxr...@gmail.com wrote: Τη Παρασκευή, 1 Απριλίου 2016 - 1:56:52 μ.μ. UTC+3, ο χρήστης sax...@gmail.com έγραψε: hello, i have windows 10 and python 3.5 and i want to use open cv but i think so opencv work only on python 2.7 ? and i install this http://www.lfd.uci.edu/~gohl

Re: Drowning in a teacup?

2016-04-01 Thread Ian Kelly
On Fri, Apr 1, 2016 at 2:39 PM, Rob Gaddi wrote: > Fillmore wrote: >> Nope, wrong! contrary to what I thought I had understood about how >> parameters are passed in Python, the function is acting on a copy(!) and >> my original list is unchanged. >> > > Nope, that's not your problem. Your problem

Re: Drowning in a teacup?

2016-04-01 Thread Michael Selik
Give this a shot def snap(keyword, words): matches = [i for i, s in enumerate(words) if s.startswith(keyword)] for i in matches: lst.insert(0, lst.pop(i)) Your current implementation is reassigning the local variable ``mylist`` to a new list inside the function. O

Re: Drowning in a teacup?

2016-04-01 Thread MRAB
On 2016-04-01 21:27, Fillmore wrote: notorious pass by reference vs pass by value biting me in the backside here. Proceeding in order. I need to scan a list of strings. If one of the elements matches the beginning of a search keyword, that element needs to snap to the front of the list. I achie

Re: Strange range

2016-04-01 Thread Marko Rauhamaa
Rob Gaddi : > Marko Rauhamaa wrote: >> There's a bit of a cognitive dissonance between iterables and iterators. >> On the one hand, they behave identically in many contexts. On the other >> hand, the distinction is crucial in some special cases. > > You're missing a key point. All (well-behaved)

Re: Drowning in a teacup?

2016-04-01 Thread Rob Gaddi
Fillmore wrote: > > notorious pass by reference vs pass by value biting me in the backside > here. Proceeding in order. > > I need to scan a list of strings. If one of the elements matches the > beginning of a search keyword, that element needs to snap to the front > of the list. > I achieved t

Re: install open cv on windows 10 and python 3.5

2016-04-01 Thread saxri89
Τη Παρασκευή, 1 Απριλίου 2016 - 1:56:52 μ.μ. UTC+3, ο χρήστης sax...@gmail.com έγραψε: > hello, > > i have windows 10 and python 3.5 and i want to use > open cv but i think so opencv work only on python 2.7 ? > and i install this http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv > but not work ag

Re: install open cv on windows 10 and python 3.5

2016-04-01 Thread MRAB
On 2016-04-01 20:11, saxr...@gmail.com wrote: Τη Παρασκευή, 1 Απριλίου 2016 - 1:56:52 μ.μ. UTC+3, ο χρήστης sax...@gmail.com έγραψε: hello, i have windows 10 and python 3.5 and i want to use open cv but i think so opencv work only on python 2.7 ? and i install this http://www.lfd.uci.edu/~gohl

Re: Set type for datetime intervals

2016-04-01 Thread Michael Selik
Whoops, I mixed up tasks. Here's what I meant: def interval(start, stop, precision=60): a, b = start.timestamp(), stop.timestamp() return set(range(a, b, precision)) On Fri, Apr 1, 2016 at 4:31 PM Michael Selik wrote: > On Fri, Apr 1, 2016 at 1:32 AM Nagy László Zsolt > wro

Re: Set type for datetime intervals

2016-04-01 Thread Michael Selik
On Fri, Apr 1, 2016 at 1:32 AM Nagy László Zsolt wrote: > Does anyone know a library that already implements these functions? > What do you not like about the ones on PyPI? https://pypi.python.org/pypi?%3Aaction=search&term=interval&submit=search Depending on the resolution you want, you might

Drowning in a teacup?

2016-04-01 Thread Fillmore
notorious pass by reference vs pass by value biting me in the backside here. Proceeding in order. I need to scan a list of strings. If one of the elements matches the beginning of a search keyword, that element needs to snap to the front of the list. I achieved that this way: for i in

Re: Strange range

2016-04-01 Thread Rob Gaddi
Marko Rauhamaa wrote: > Erik : > >> On 01/04/16 15:34, Marko Rauhamaa wrote: >>> Chris Angelico : >>> *A range object is not an iterator.* >>> >>> We now have learned as much. >>> >>> However, doesn't that extra level of indirection seem like an odd >>> choice? >> >> [...] >> >> If you write

Re: Strange range

2016-04-01 Thread Marko Rauhamaa
Erik : > On 01/04/16 15:34, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> *A range object is not an iterator.* >> >> We now have learned as much. >> >> However, doesn't that extra level of indirection seem like an odd >> choice? > > [...] > > If you write your own class which has an __iter__ me

Re: Strange range

2016-04-01 Thread Erik
On 01/04/16 15:34, Marko Rauhamaa wrote: Chris Angelico : *A range object is not an iterator.* We now have learned as much. However, doesn't that extra level of indirection seem like an odd choice? If you write your own class which has an __iter__ method, would you expect: >>> o = MyCla

RE: extract rar

2016-04-01 Thread Albert-Jan Roskam
> Date: Fri, 1 Apr 2016 13:22:12 -0600 > Subject: extract rar > From: fanjianl...@gmail.com > To: python-list@python.org > > Hello everyone, > > I am wondering is there any way to extract rar files by python without > WinRAR software? > > I tried Archive() and patool, but seems they required t

Re: extract rar

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 15:22, Jianling Fan wrote: > Hello everyone, > > I am wondering is there any way to extract rar files by python without > WinRAR software? > > I tried Archive() and patool, but seems they required the WinRAR > software. Rar is a proprietary format. They do distribute a fr

extract rar

2016-04-01 Thread Jianling Fan
Hello everyone, I am wondering is there any way to extract rar files by python without WinRAR software? I tried Archive() and patool, but seems they required the WinRAR software. Thanks, Regards, Jianling -- https://mail.python.org/mailman/listinfo/python-list

RE: A tool to add diagrams to sphinx docs

2016-04-01 Thread Albert-Jan Roskam
> Subject: Re: A tool to add diagrams to sphinx docs > From: irmen.nos...@xs4all.nl > Date: Fri, 1 Apr 2016 18:26:48 +0200 > To: python-list@python.org > > On 1-4-2016 17:59, George Trojan - NOAA Federal wrote: > > What graphics editor would you recommend to create diagrams that can be > > inclu

Re: install open cv on windows 10 and python 3.5

2016-04-01 Thread saxri89
Τη Παρασκευή, 1 Απριλίου 2016 - 1:56:52 μ.μ. UTC+3, ο χρήστης sax...@gmail.com έγραψε: > hello, > > i have windows 10 and python 3.5 and i want to use > open cv but i think so opencv work only on python 2.7 ? > and i install this http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv > but not work ag

Re: install open cv on windows 10 and python 3.5

2016-04-01 Thread Terry Reedy
On 4/1/2016 6:56 AM, saxr...@gmail.com wrote: hello, i have windows 10 and python 3.5 and i want to use open cv but i think so opencv work only on python 2.7 ? The following link has binaries for 3.4 and 3.5 as well. I believe Gohlke tests his binaries, so I expect them to work. and i ins

Re: [Python-ideas] Decorators for variables

2016-04-01 Thread Ian Kelly
On Fri, Apr 1, 2016 at 11:14 AM, Matthias welp wrote: >> An example of the transformation would help here > > An example, that detects cycles in a graph, and doesn't do an update if > the graph has cycles. Thanks. > class A(object): > def __init__(self, parent): > @prevent_cycles >

Re: A tool to add diagrams to sphinx docs

2016-04-01 Thread Irmen de Jong
On 1-4-2016 17:59, George Trojan - NOAA Federal wrote: > What graphics editor would you recommend to create diagrams that can be > included in sphinx made documentation? In the past I used xfig, but was not > happy with font quality. My understanding is the diagrams would be saved in > a .png file

A tool to add diagrams to sphinx docs

2016-04-01 Thread George Trojan - NOAA Federal
What graphics editor would you recommend to create diagrams that can be included in sphinx made documentation? In the past I used xfig, but was not happy with font quality. My understanding is the diagrams would be saved in a .png file and I should use an image directive in the relevant .rst file.

Re: Set type for datetime intervals

2016-04-01 Thread Random832
More thoughts... sorry. On Fri, Apr 1, 2016, at 01:24, Nagy László Zsolt wrote: > > Hello, > > I need to compare sets of datetime intervals, and make set operations on > them: intersect, union, difference etc. One element of a set would be an > interval like this: > > element ::= (start_poin

Re: Strange range

2016-04-01 Thread Marko Rauhamaa
Chris Angelico : > On Sat, Apr 2, 2016 at 1:34 AM, Marko Rauhamaa wrote: >> However, doesn't that extra level of indirection seem like an odd >> choice? > > No; a range object is an entity in itself. You can test if something's > within the range: > 5 in range(2,10) > True 5 in range(2,

Re: The next major Python version will be Python 8

2016-04-01 Thread Gene Heskett
On Friday 01 April 2016 09:06:20 Gisle Vanem via Python-list wrote: > Michael Selik wrote: > > It suddenly occurred to me that if Microsoft announced it's > > Ubuntu-in-Windows feature today, no one would believe it. > > My feeling too, but this was announced 30 March. > In the video in this link:

Re: Set type for datetime intervals

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 01:24, Nagy László Zsolt wrote: > > Hello, > > I need to compare sets of datetime intervals, and make set operations on > them: intersect, union, difference etc. One element of a set would be an > interval like this: Two thoughts on this: Such an object is not precisel

Re: Strange range

2016-04-01 Thread Ian Kelly
On Fri, Apr 1, 2016 at 8:42 AM, Random832 wrote: > On Fri, Apr 1, 2016, at 09:24, Chris Angelico wrote: >> It is an iterable. It is not a factory, as that implies that you call >> it. > > I do have an objection to this statement. It's perfectly reasonable to > describe the factory pattern as apply

Re: Strange range

2016-04-01 Thread Chris Angelico
On Sat, Apr 2, 2016 at 1:42 AM, Random832 wrote: > On Fri, Apr 1, 2016, at 09:24, Chris Angelico wrote: >> It is an iterable. It is not a factory, as that implies that you call >> it. > > I do have an objection to this statement. It's perfectly reasonable to > describe the factory pattern as apply

Re: Strange range

2016-04-01 Thread Chris Angelico
On Sat, Apr 2, 2016 at 1:34 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> *A range object is not an iterator.* > > We now have learned as much. > > However, doesn't that extra level of indirection seem like an odd > choice? No; a range object is an entity in itself. You can test if something'

Re: Suggestion: make sequence and map interfaces more similar

2016-04-01 Thread Rustom Mody
On Friday, April 1, 2016 at 1:58:29 PM UTC+5:30, Tim Golden wrote: > > For the latter, I take the view that I know where the delete key is (or > the "ignore thread" button or whatever) and I just skip the thread when > it shows up. > Feel free to contact the list owner [python list-owner] if >

Re: Strange range

2016-04-01 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Chris Angelico wrote: > >> *A range object is not an iterator.* > > We now have learned as much. > > However, doesn't that extra level of indirection seem like an odd > choice? I think it's brilliant. The range object behaves like a tuple containing the numbers in the rang

Re: Strange range

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 09:24, Chris Angelico wrote: > It is an iterable. It is not a factory, as that implies that you call > it. I do have an objection to this statement. It's perfectly reasonable to describe the factory pattern as applying to objects on which you call a method to return the new

Re: Strange range

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 10:12, Marko Rauhamaa wrote: > Yes, I realize it now. I had thought it was: > > def range(start, end=None, step=1): > if end is None: > start, end = 0, start > i = start > while step * (end - i) > 0: > yield i >

Re: Strange range

2016-04-01 Thread Marko Rauhamaa
Chris Angelico : > *A range object is not an iterator.* We now have learned as much. However, doesn't that extra level of indirection seem like an odd choice? Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange range

2016-04-01 Thread Marko Rauhamaa
Fabien : > On 04/01/2016 03:26 PM, Steven D'Aprano wrote: >> Incorrect. range is a lazy sequence. > > But how does range "know" that it has to start from scratch again? The "for .. in" statement invokes the __iter__() method of the iterable object to get an iterator (maybe via the builtin iter()

Re: The next major Python version will be Python 8

2016-04-01 Thread Grant Edwards
On 2016-04-01, alister wrote: > On Fri, 01 Apr 2016 11:13:43 +1100, Chris Angelico wrote: > >> On Fri, Apr 1, 2016 at 11:09 AM, Ethan Furman >> wrote: >>> On 03/31/2016 05:02 PM, Roel Schroeven wrote: Victor Stinner schreef op 2016-03-31 23:40: >>> >>> > Python 3 becomes more and mo

Re: Strange range

2016-04-01 Thread Chris Angelico
On Sat, Apr 2, 2016 at 1:16 AM, Fabien wrote: > On 04/01/2016 03:26 PM, Steven D'Aprano wrote: >> >> Incorrect. range is a lazy sequence. > > > But how does range "know" that it has to start from scratch again? As in > this example: > > it = range(10) > for i in it: > if i >= 3: > brea

Re: Strange range

2016-04-01 Thread Jussi Piitulainen
Fabien writes: > On 04/01/2016 03:26 PM, Steven D'Aprano wrote: >> Incorrect. range is a lazy sequence. > > But how does range "know" that it has to start from scratch again? As > in this example: > > it = range(10) > for i in it: > if i >= 3: > break > for i in it: > # why does it

Re: Strange range

2016-04-01 Thread Fabien
On 04/01/2016 03:26 PM, Steven D'Aprano wrote: Incorrect. range is a lazy sequence. But how does range "know" that it has to start from scratch again? As in this example: it = range(10) for i in it: if i >= 3: break for i in it: # why does it start from zero again? print(

Re: Strange range

2016-04-01 Thread Marko Rauhamaa
Steven D'Aprano : > On Sat, 2 Apr 2016 12:15 am, Marko Rauhamaa wrote: >> Note to self: range(10) is an iterator factory, not an iterator. > > Incorrect. range is a lazy sequence. Incorrect. You and I agree. > You can think of range as equivalent to something close to this: > > class Range(objec

Re: The next major Python version will be Python 8

2016-04-01 Thread Gisle Vanem via Python-list
Michael Selik wrote: > It suddenly occurred to me that if Microsoft announced it's > Ubuntu-in-Windows feature today, no one would believe it. My feeling too, but this was announced 30 March. In the video in this link: http://www.cnx-software.com/2016/03/31/microsoft-brings-bash-on-ubuntu-on-w

Re: Strange range

2016-04-01 Thread Steven D'Aprano
On Sat, 2 Apr 2016 12:15 am, Marko Rauhamaa wrote: > > This seems sane: [...] > This not so much: > > >>> it = range(10) > >>> for i in it: > ... if i >= 3: > ... break > ... > >>> list(it) > [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] > > Note to self: range(10) is an it

Re: Strange range

2016-04-01 Thread Chris Angelico
On Sat, Apr 2, 2016 at 12:15 AM, Marko Rauhamaa wrote: > Note to self: range(10) is an iterator factory, not an iterator. It is an iterable. It is not a factory, as that implies that you call it. It is an object which, when you ask it for an iterator, gives you an iterator. That's called an itera

Strange range

2016-04-01 Thread Marko Rauhamaa
This seems sane: >>> it = iter(range(10)) >>> for i in it: ... if i >= 3: ... break ... >>> list(it) [4, 5, 6, 7, 8, 9] As does this: >>> it = iter(list(range(10))) >>> for i in it: ... if i >= 3: ... break ... >>> list(it) [4,

install open cv on windows 10 and python 3.5

2016-04-01 Thread saxri89
hello, i have windows 10 and python 3.5 and i want to use open cv but i think so opencv work only on python 2.7 ? and i install this http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv but not work again -- https://mail.python.org/mailman/listinfo/python-list

Re: Suggestion: make sequence and map interfaces more similar

2016-04-01 Thread Marko Rauhamaa
Steven D'Aprano : > On Fri, 1 Apr 2016 07:27 pm, Tim Golden wrote: > >> FWIW I'm broadly with Antoon here: wider-ranging discussions can be >> interesting and useful. > > Sure. But sometimes conversations are going nowhere: That's why GNUS has the "k" command to wipe out a whole thread. I know,

Re: Suggestion: make sequence and map interfaces more similar

2016-04-01 Thread Steven D'Aprano
On Fri, 1 Apr 2016 07:27 pm, Tim Golden wrote: > FWIW I'm broadly with Antoon here: wider-ranging discussions can be > interesting and useful. Sure. But sometimes conversations are going nowhere: http://www.youtube.com/watch?v=kQFKtI6gn9Y http://www.montypython.net/scripts/argument.php [...]

Re: The next major Python version will be Python 8

2016-04-01 Thread Chris Angelico
On Fri, Apr 1, 2016 at 8:44 PM, alister wrote: > On Fri, 01 Apr 2016 11:13:43 +1100, Chris Angelico wrote: > >> Now's the time to get in with the ideas. My proposal is that Python 8, >> in keeping with its new opinionated style, will require everyone to >> follow a single timezone: Europe/Amsterda

Re: The next major Python version will be Python 8

2016-04-01 Thread alister
On Fri, 01 Apr 2016 11:13:43 +1100, Chris Angelico wrote: > On Fri, Apr 1, 2016 at 11:09 AM, Ethan Furman > wrote: >> On 03/31/2016 05:02 PM, Roel Schroeven wrote: >>> >>> Victor Stinner schreef op 2016-03-31 23:40: >> >> Python 3 becomes more and more popular and is close to a dangerous >>>

Re: Suggestion: make sequence and map interfaces more similar

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 08:59, Antoon Pardon wrote: Op 31-03-16 om 16:12 schreef Mark Lawrence via Python-list: On 31/03/2016 14:27, Random832 wrote: So can we discuss how a unified method to get a set of all valid subscripts (and/or subscript-value pairs) on an object would be a useful thing to have wit

Re: The next major Python version will be Python 8

2016-04-01 Thread Michael Selik
It suddenly occurred to me that if Microsoft announced it's Ubuntu-in-Windows feature today, no one would believe it. On Thu, Mar 31, 2016 at 11:55 PM Steven D'Aprano wrote: > On Fri, 1 Apr 2016 11:13 am, Chris Angelico wrote: > > > Now's the time to get in with the ideas. My proposal is that Py

Re: Suggestion: make sequence and map interfaces more similar

2016-04-01 Thread Tim Golden
On 01/04/2016 08:59, Antoon Pardon wrote: > Op 31-03-16 om 16:12 schreef Mark Lawrence via Python-list: >> On 31/03/2016 14:27, Random832 wrote: >>> So can we discuss how a unified method to get a set of all valid >>> subscripts (and/or subscript-value pairs) on an object would be a useful >>> thin

Re: Suggestion: make sequence and map interfaces more similar

2016-04-01 Thread Michael Selik
> On Mar 31, 2016, at 10:02 AM, Marko Rauhamaa wrote: > > However, weirdly, dicts have get but lists don't. Read PEP 463 for discussion on this topic. https://www.python.org/dev/peps/pep-0463/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Suggestion: make sequence and map interfaces more similar

2016-04-01 Thread Antoon Pardon
Op 31-03-16 om 16:12 schreef Mark Lawrence via Python-list: > On 31/03/2016 14:27, Random832 wrote: >> So can we discuss how a unified method to get a set of all valid >> subscripts (and/or subscript-value pairs) on an object would be a useful >> thing to have without getting bogged down in theoret

Help is needed!

2016-04-01 Thread A. ElKader
Hi, I am trying to do the following : I am trying to show the changes in the command line in real time in my Tkinter GUI, I managed to create the GUI and integrate the terminal into it, but I cant bind the buttons with the terminal, my code is : import Tkinterfrom Tkinter import *import subproce

Ammended proposal: Python 832? Re: The next major Python version will be Python 8

2016-04-01 Thread Stefan Hagen
Sorry for the blunt terseness, but wasn't the plan to target Python 832 i.e. 8.3.2 as a single, frozen thus *eternal* version tag to firstly integrate all beauty (PEP8), good (3.x), bad (2.x) and secondly **never** have to embrace those thrilling, dirty changes again, was it? $ python832 -m stefan