Re: Anyone still using Python 2.5?

2011-12-21 Thread Stefan Behnel
Dennis Lee Bieber, 21.12.2011 17:48: On Wed, 21 Dec 2011 07:15:46 +, Chris Withers wrote: What's the general consensus on supporting Python 2.5 nowadays? Do people still have to use this in commercial environments or is everyone on 2.6+ nowadays? I was recently laid-off from a program tha

Re: Generator Question

2011-12-21 Thread Steven D'Aprano
On Wed, 21 Dec 2011 21:45:13 -0800, GZ wrote: > Now the question here is this: > > def h(): > if condition=true: >#I would like to return an itereator with zero length > else: >for ...: yield x > > In other words, when certain condition is met, I want to yield nothing. >

Re: Generator Question

2011-12-21 Thread Chris Angelico
On Thu, Dec 22, 2011 at 4:45 PM, GZ wrote: > def h(): >    if condition=true: >       #I would like to return an itereator with zero length >    else: >       for ...: yield x Easy. Just 'return' in the conditional. >>> def h(): if condition: return for i in range

Re: Generator Question

2011-12-21 Thread Steven D'Aprano
On Wed, 21 Dec 2011 21:45:13 -0800, GZ wrote: > Hi, > > I am wondering what would be the best way to return an iterator that has > zero items. return iter([]) > I just noticed the following two are different: > > def f(): >pass That creates a function that does nothing, and then returns

Generator Question

2011-12-21 Thread GZ
Hi, I am wondering what would be the best way to return an iterator that has zero items. I just noticed the following two are different: def f(): pass def g(): if 0: yield 0 pass for x in f(): print x Traceback (most recent call last): File "", line 1, in TypeError: 'NoneType' obj

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Steven D'Aprano
On Wed, 21 Dec 2011 21:15:31 -0500, Nathan Rice wrote: > Just because the default python version on a server is 2.4 doesn't mean > you can't install 2.7.2... If the admins that run the machine are too > lazy/stupid to install a second copy of Python let them rot. If any of my sys admins installed

Re: Why widgets become 'NoneType'?

2011-12-21 Thread Rick Johnson
On Dec 21, 6:59 am, Muddy Coder wrote: > Hi Folks, > > I was driven nuts by this thing: widgets lost their attributes, then I > can't configure them. Please take a look at the codes below: The problem is here... >     labels = [] >     for i in range(len(astr)): >         lbl = Label(win, text=

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Nathan Rice
Just because the default python version on a server is 2.4 doesn't mean you can't install 2.7.2... If the admins that run the machine are too lazy/stupid to install a second copy of Python let them rot. Of course, if by some nightmare scenario you have code that can't be upgraded for whatever reas

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Gregory P. Smith
On Wed, Dec 21, 2011 at 2:57 AM, Jim Fulton wrote: > On Wed, Dec 21, 2011 at 2:15 AM, Chris Withers > wrote: > > Hi All, > > > > What's the general consensus on supporting Python 2.5 nowadays? > > > > Do people still have to use this in commercial environments or is > everyone > > on 2.6+ nowada

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Roy Smith
In article , Grant Edwards wrote: > C++ is a vast, complex, and dangerous language -- and industry > doesn't seem to be willing to limit itself to using the seven people > on the planet who understand it. > I'm only half joking... :) Half joking, indeed. I happen to know for a fact that th

Re: what does 'a=b=c=[]' do

2011-12-21 Thread alex23
On Dec 22, 8:25 am, Eric wrote: > This surprises me, can someone tell me why it shouldn't?  I figure if > I want to create and initialize three scalars the just do "a=b=c=7", > for example, so why not extend it to arrays. The thing to remember is that everything is an object, and that it's better

Re: what does 'a=b=c=[]' do

2011-12-21 Thread Steven D'Aprano
On Wed, 21 Dec 2011 18:20:16 -0500, Dennis Lee Bieber wrote: > For the amount of typing, it's easier to just do a straight line > tuple unpack > a,b,c = ([],[],[]) Note that tuples are created by the comma, not the round brackets (or parentheses for any Americans reading). So the rou

Re: what does 'a=b=c=[]' do

2011-12-21 Thread Steven D'Aprano
On Wed, 21 Dec 2011 14:25:17 -0800, Eric wrote: > Is it true that if I want to create an array or arbitrary size such as: >for a in range(n): > x.append() x is not defined, so you will get a NameError unless by some lucky fluke something else has created x AND it happens to be a list.

Re: what does 'a=b=c=[]' do

2011-12-21 Thread Chris Kaynor
On Wed, Dec 21, 2011 at 2:25 PM, Eric wrote: > > Is it true that if I want to create an array or arbitrary size such > as: > for a in range(n): > x.append() > > I must do this instead? > x=[] > for a in range(n): > x.append() You can also use a list comprehension: x = [ for a in

Re: what does 'a=b=c=[]' do

2011-12-21 Thread Joshua Landau
On 21 December 2011 22:25, Eric wrote: > Is it true that if I want to create an array or arbitrary size such > as: > for a in range(n): > x.append() > > I must do this instead? > x=[] > for a in range(n): > x.append() > > Now to my actual question. I need to do the above for mult

what does 'a=b=c=[]' do

2011-12-21 Thread Eric
Is it true that if I want to create an array or arbitrary size such as: for a in range(n): x.append() I must do this instead? x=[] for a in range(n): x.append() Now to my actual question. I need to do the above for multiple arrays (all the same, arbitrary size). So I do thi

Re: Need advice on the design of my application

2011-12-21 Thread Chris Kaynor
On Wed, Dec 21, 2011 at 2:10 PM, carlos choy wrote: > Thank you for your great advice. It is detailed and tells me what I need > to know, I wasn't expecting such an accurate response from anyone for some > time. > > I think Option 2 is the way I will go. Having never embedded before, I > think

Re: Need advice on the design of my application

2011-12-21 Thread Miki Tebeka
I'd say go with option 1. Pass the window handler (or DC) to the rendered thread. To overcome the GIL problem, you can use Py_BEGIN_ALLOW_THREADS (see http://docs.python.org/release/1.5.2/api/threads.html) -- http://mail.python.org/mailman/listinfo/python-list

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Hans Mulder
On 21/12/11 01:03:26, Ian Kelly wrote: As type conversion functions, bool(x) and int(x) should *always* return bools and ints respectively > (or raise an exception), no matter what you pass in for x. That doesn't always happen in 2.x: >>> type(int(1e42)) This was fixed in 3.0. -- HansM -- h

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Brett Cannon
On Wed, Dec 21, 2011 at 05:57, Jim Fulton wrote: > On Wed, Dec 21, 2011 at 2:15 AM, Chris Withers > wrote: > > Hi All, > > > > What's the general consensus on supporting Python 2.5 nowadays? > > > > Do people still have to use this in commercial environments or is > everyone > > on 2.6+ nowadays

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Ethan Furman
Grant Edwards wrote: On 2011-12-21, Neil Cerutti wrote: I cheerfully agree that programmers ignorant of C++ should not write programs in it. But furthermore, they should also not define a subset of C++ for use in embedded programming. ;) I fully agree that programmers ignorant of C++ should n

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Grant Edwards
On 2011-12-21, Neil Cerutti wrote: > On 2011-12-21, Grant Edwards wrote: >> Templates are how C++ does generics and I'd expect them to appear in be used in embedded programming as well as elsewhere. >> >> I've only worked on the perphery of a couple embedded projects that >> used C++, b

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Chris . Wesseling
On 2011-12-21T07:15:46+, Chris Withers wrote: > Hi All, > > What's the general consensus on supporting Python 2.5 nowadays? > > Do people still have to use this in commercial environments or is > everyone on 2.6+ nowadays? 2.5, how modern. SUSE Linux Enterprise Server 10 comes with 2.4.2 Wi

Re: Why does this launch an infinite loop of new processes?

2011-12-21 Thread Andrew Berg
On 12/21/2011 1:29 PM, Ethan Furman wrote: > Anything that runs at import time should be protected by the `if > __name__ == '__main__'` idiom as the children will import the __main__ > module. So the child imports the parent and runs the spawn code again? That makes sense. -- CPython 3.2.2 | Wi

Re: Why does this launch an infinite loop of new processes?

2011-12-21 Thread Ethan Furman
Andrew Berg wrote: I am trying to understand the multiprocessing module, and I tried some simple code: import multiprocessing def f(): print('bla bla') p = multiprocessing.Process(target=f) p.start() p.join() And the result is a new process that spawns a new process that spawns a new pr

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Ethan Furman
Ian Kelly wrote: my goal is to write clear code, not great one-liners. :-D +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie OOP Question & Code Snippet

2011-12-21 Thread Joshua Landau
On 21 December 2011 19:12, Dean Richardson P.Eng wrote: > Hi All, > I'm a newbie just learning Python, using a couple of books to learn the > language. (Books: "Visual Quickstart Guide - Python, 2nd Ed", "Practical > Programming - An Intro to Computer Science using Python"). I'm just now > learnin

Re: Need advice on the design of my application

2011-12-21 Thread Chris Kaynor
On Wed, Dec 21, 2011 at 11:19 AM, hbd666 wrote: > > > In my experience implementing Option 1 in another project, I know that > Python suspends > execution until the DLL function calls return, but I did not launch the > DLL on a thread. > I expect that if the DLL were launched on a thread, a func

Re: Newbie OOP Question & Code Snippet

2011-12-21 Thread MRAB
On 21/12/2011 19:12, Dean Richardson P.Eng wrote: Hi All, I'm a newbie just learning Python, using a couple of books to learn the language. (Books: "Visual Quickstart Guide - Python, 2nd Ed", "Practical Programming - An Intro to Computer Science using Python"). I'm just now learning OOP material

Need advice on the design of my application

2011-12-21 Thread hbd666
I am writing a hull-wave simulator for the design of boat hulls as they are affected by waves. This application is composed of 2 main parts, the part that renders the waves and its impact on the hull, and a GUI that controls the hull shape, waves, and other factors. The two parts of the appl

Newbie OOP Question & Code Snippet

2011-12-21 Thread Dean Richardson P.Eng
Hi All, I'm a newbie just learning Python, using a couple of books to learn the language. (Books: "Visual Quickstart Guide - Python, 2nd Ed", "Practical Programming - An Intro to Computer Science using Python"). I'm just now learning OOP material as presented in both books -- I'm new to this approa

Re: Why does this launch an infinite loop of new processes?

2011-12-21 Thread Joshua Landau
On 21 December 2011 18:59, Andrew Berg wrote: > I am trying to understand the multiprocessing module, and I tried some > simple code: > > import multiprocessing > def f(): >print('bla bla') > p = multiprocessing.Process(target=f) > p.start() > p.join() > > And the result is a new process

Re: Why does this launch an infinite loop of new processes?

2011-12-21 Thread Andrew Berg
On 12/21/2011 1:07 PM, Joshua Landau wrote: > Eh? It works for me. Python 3.2 + 2.7 > Is this the full code? That is the full code. -- CPython 3.2.2 | Windows NT 6.1.7601.17640 | Thunderbird 7.0 -- http://mail.python.org/mailman/listinfo/python-list

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Nathan Rice
On Wed, Dec 21, 2011 at 1:41 PM, Ian Kelly wrote: > > I expected the equivalent of: > > remainder = [n % d for (n, d) in zip(numerator, denominator)] > > which is what numpy does. I do want to come up with a nice way to do that... However: if numerator and denominator are plain lists that magica

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Joshua Landau
On 21 December 2011 19:00, Joshua Landau wrote: > On 21 December 2011 18:57, Ian Kelly wrote: > >> On Wed, Dec 21, 2011 at 9:48 AM, Joshua Landau >> wrote: >> > NOW (the PEP): >> > item = foreignfunc1~(item) >> > item = foreignfunc2~(item) >> > item = foreignfunc3~(item) >> >> Just a note: PEP

Why does this launch an infinite loop of new processes?

2011-12-21 Thread Andrew Berg
I am trying to understand the multiprocessing module, and I tried some simple code: import multiprocessing def f(): print('bla bla') p = multiprocessing.Process(target=f) p.start() p.join() And the result is a new process that spawns a new process that spawns a new process ad infinitum un

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Joshua Landau
On 21 December 2011 18:57, Ian Kelly wrote: > On Wed, Dec 21, 2011 at 9:48 AM, Joshua Landau > wrote: > > NOW (the PEP): > > item = foreignfunc1~(item) > > item = foreignfunc2~(item) > > item = foreignfunc3~(item) > > Just a note: PEP 225 does not actually include this syntax for > arbitrary fun

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Ian Kelly
On Wed, Dec 21, 2011 at 9:48 AM, Joshua Landau wrote: > NOW (the PEP): > item = foreignfunc1~(item) > item = foreignfunc2~(item) > item = foreignfunc3~(item) Just a note: PEP 225 does not actually include this syntax for arbitrary function calls. It only proposes to augment the arithmetic and as

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Joshua Landau
On 21 December 2011 18:32, Nathan Rice wrote: > On Wed, Dec 21, 2011 at 1:24 PM, Joshua Landau > wrote: > > I was under the impression that these were meant to be interchangeable. > This > > is because functions are just wrappers to non-functions, really. > > > from elementwise import Elemen

Multiprocessing.Pipe in a daemon

2011-12-21 Thread Falcolas
So, I'm running into a somewhat crazy bug. I am running several workers using multiprocessing to handle gearman requests. I'm using pipes to funnel log messages from each of the workers back to the controlling process, which iterates over the other end of the pipe, looking for messages with poll()

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Ian Kelly
On Wed, Dec 21, 2011 at 11:27 AM, Nathan Rice wrote: > Ian, can you clarify the expected output in that case?  My initial > guess would be that you want to do a modulo on the cartesian product > of parameters from the proxies, sort of like: > > import itertools > numerator = range(5) > denominator

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Ian Kelly
On Wed, Dec 21, 2011 at 11:24 AM, Joshua Landau wrote: > I was under the impression that these were meant to be interchangeable. This > is because functions are just wrappers to non-functions, really. > from elementwise import ElementwiseProxy as P (lambda x:x+[1])(P([[0],[0],[0]])) > [0

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Nathan Rice
On Wed, Dec 21, 2011 at 1:24 PM, Joshua Landau wrote: > I was under the impression that these were meant to be interchangeable. This > is because functions are just wrappers to non-functions, really. > from elementwise import ElementwiseProxy as P (lambda x:x+[1])(P([[0],[0],[0]])) > [0,

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Nathan Rice
> It doesn't seem to work correctly when both operands are Elementwise: > numerator = ElementwiseProxy(range(5)) denominator = ElementwiseProxy([2, 2, 3, 3, 3]) remainder = numerator % denominator print remainder > Traceback (most recent call last): >  File "", line 1, in >  Fi

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Joshua Landau
On 21 December 2011 17:51, Ian Kelly wrote: > On Wed, Dec 21, 2011 at 9:48 AM, Joshua Landau > wrote: > > functions, that before you were doing on a single item. > > BEFORE: > > item = foreignfunc1(item) > > item = foreignfunc2(item) > > item = foreignfunc3(item) > > > > NOW (your method): > > i

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Nathan Rice
On Wed, Dec 21, 2011 at 12:53 PM, Arnaud Delobelle wrote: > > You can already do: > > efoo2 = ["one", "two", "three", "four"] > ["_".join(reversed((x.capitalize() + " little indian").split(" ")) * 2) >     for x in efoo2] > > Note 1: I've ignored the fact that reversed(...)*2 is erroneous > Note 2

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Nathan Rice
>> On Tue, Dec 20, 2011 at 8:37 PM, Joshua Landau >> wrote: >> > On 21 December 2011 00:24, Nathan Rice >> > wrote: >> >> efoo_res = ((efoo2.capitalize() + " little indian").split(" >> >> ").apply(reversed) * 2).apply("_".join) # note that you could do >> >> reversed(...) instead, I just like to

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Ian Kelly
On Tue, Dec 20, 2011 at 12:45 PM, Nathan Rice wrote: > Elementwise provides a proxy object for iterables which supports > chained method calls, as well as elementwise expressions and some > built-in functions. It doesn't seem to work correctly when both operands are Elementwise: >>> numerator =

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Ethan Furman
Steven D'Aprano wrote: I'm just glad that you've put your money where your mouth is, and released the package, instead of demanding others do the work. Thank you. +1000! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Arnaud Delobelle
On 21 December 2011 00:24, Nathan Rice wrote: > efoo2 = ElementwiseProxy(["one", "two", "three", "four"]) > > efoo_res = ((efoo2.capitalize() + " little indian").split(" > ").apply(reversed) * 2).apply("_".join) # note that you could do > reversed(...) instead, I just like to read left to right >

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Ian Kelly
On Wed, Dec 21, 2011 at 9:48 AM, Joshua Landau wrote: > functions, that before you were doing on a single item. > BEFORE: > item = foreignfunc1(item) > item = foreignfunc2(item) > item = foreignfunc3(item) > > NOW (your method): > item = ElementwiseProxy(item) > item = foreignfunc1(item) > item =

Re: Why widgets become 'NoneType'?

2011-12-21 Thread woooee
The error is with the labels not the canvas. All labels will have an id of "None" as that is what pack() returns.         lbl = Label(win, text=astr[i]).pack(side=LEFT )         labels.append(lbl) The error will come up in the config_labels function when the program tries to config a tuple of "N

Re: Learning Python 2.4

2011-12-21 Thread Andreas Perstinger
On 2011-12-20 19:31, kimma wrote: I am about to learn python with "how to think like a computer scientist". This book is just available for python 2.4. Does it matter for programming? There is also a online-version for Python 3 but there are some differences: http://openbookproject.net/thinkcs/

Re: Anyone still using Python 2.5?

2011-12-21 Thread Tim Chase
On 12/21/11 07:07, Roy Smith wrote: In article<4ef1b9fa$0$29973$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: Centos and Red Hat production systems still use Python 2.4, so yes, absolutely, 2.5 and 2.4 still need to be supported. Is Python 2.4 destined to be the next IE-6?

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Nathan Rice
On Wed, Dec 21, 2011 at 12:07 PM, Paul Dubois wrote: > You're reinventing Numeric Python. I prefer to think of it in terms of paying homage to NumPy (and functional programming). A big part of the motivation for this was bringing the elegance of NumPy to other areas of python besides numerical/s

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Paul Dubois
You're reinventing Numeric Python. On Tue, Dec 20, 2011 at 11:45 AM, Nathan Rice < nathan.alexander.r...@gmail.com> wrote: > Elementwise provides a proxy object for iterables which supports > chained method calls, as well as elementwise expressions and some > built-in functions. > > Example: > >

Re: Python education survey

2011-12-21 Thread Nathan Rice
+1 for IPython/%edit using the simplest editor that supports syntax highlighting and line numbers. I have found that Exploring/Prototyping in the interpreter has the highest ROI of anything I teach people. Nathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-21 Thread Joshua Landau
On 21 December 2011 15:48, Neal Becker wrote: > Clarification: where can packing/unpacking syntax be used? > > It would be great if it were valid essentially anywhere (not limited to > parameter passing). > > What about constructs like: > > a, @tuple tail, b = sequence? >>> a, *b, c = range(10)

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-21 Thread Ethan Furman
Neal Becker wrote: Clarification: where can packing/unpacking syntax be used? It would be great if it were valid essentially anywhere (not limited to parameter passing). What about constructs like: a, @tuple tail, b = sequence? You mean like Python 3's: a, *middle, b = sequence ? -- htt

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Joshua Landau
On 21 December 2011 15:07, Nathan Rice wrote: > On Tue, Dec 20, 2011 at 8:37 PM, Joshua Landau > wrote: > > On 21 December 2011 00:24, Nathan Rice > > wrote: > >> efoo_res = ((efoo2.capitalize() + " little indian").split(" > >> ").apply(reversed) * 2).apply("_".join) # note that you could do > >

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Nathan Rice
On Wed, Dec 21, 2011 at 11:29 AM, Robert Kern wrote: > On 12/21/11 3:15 PM, Nathan Rice wrote: > >>> Incidentally, displaying an ElementwiseProxy instance doesn't go down >>> well with iPython: >>> >>> In [1]: from elementwise import * >>> >>> In [2]: e = ElementwiseProxy(['one','two','three']) >>

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Robert Kern
On 12/21/11 3:15 PM, Nathan Rice wrote: Incidentally, displaying an ElementwiseProxy instance doesn't go down well with iPython: In [1]: from elementwise import * In [2]: e = ElementwiseProxy(['one','two','three']) In [3]: e Out[3]: ERROR: An unexpected error occurred while tokenizing input T

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Neil Cerutti
On 2011-12-21, Grant Edwards wrote: > On 2011-12-21, Neil Cerutti wrote: >> On 2011-12-20, Paul Rubin wrote: >>> Grant Edwards writes: Oops. I should have mentioned this is for embedded systems programming so templates in general (and STL in particular) are probably off the table

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-21 Thread Neal Becker
Clarification: where can packing/unpacking syntax be used? It would be great if it were valid essentially anywhere (not limited to parameter passing). What about constructs like: a, @tuple tail, b = sequence? -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Grant Edwards
On 2011-12-21, Neil Cerutti wrote: > On 2011-12-20, Paul Rubin wrote: >> Grant Edwards writes: >>> Oops. I should have mentioned this is for embedded systems >>> programming so templates in general (and STL in particular) >>> are probably off the table. >> >> Templates are how C++ does generics

Re: Learning Python 2.4

2011-12-21 Thread Ashton Fagg
On 21 December 2011 20:06, DJC wrote: > > In which case the most important thing is the quality of the book as a > text on Programming. If you find the the author's style to your taste, > then use that book rather than struggle with a text based on a recent > version that you personally find unrea

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Nathan Rice
> Have you seen PyLINQ? It has a similar approach to operating on > collections, returning a PyLINQ object after each call to facilitate > chaining. https://github.com/kalessin/PyLINQ/blob/master/pylinq/linq.py I hadn't seen it previously. I am a VERY heavy user of SQL Alchemy though, and I am su

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Nathan Rice
On Tue, Dec 20, 2011 at 8:37 PM, Joshua Landau wrote: > On 21 December 2011 00:24, Nathan Rice > wrote: >> efoo_res = ((efoo2.capitalize() + " little indian").split(" >> ").apply(reversed) * 2).apply("_".join) # note that you could do >> reversed(...) instead, I just like to read left to right >>

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Roy Smith
In article <9le7c5f1l...@mid.individual.net>, Neil Cerutti wrote: > On 2011-12-20, Paul Rubin wrote: > > Grant Edwards writes: > >> Oops. I should have mentioned this is for embedded systems > >> programming so templates in general (and STL in particular) > >> are probably off the table. > > >

Re: [OT] Quick intro to C++ for a Python and C user?

2011-12-21 Thread Neil Cerutti
On 2011-12-20, Paul Rubin wrote: > Grant Edwards writes: >> Oops. I should have mentioned this is for embedded systems >> programming so templates in general (and STL in particular) >> are probably off the table. > > Templates are how C++ does generics and I'd expect them to > appear in be used i

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Roy Smith
In article , Tom Davis wrote: > For those of us living the nightmare of AppEngine I've never used AppEngine, just read a little about it. Could you explain why it's a nightmare? -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python 2.4

2011-12-21 Thread Kevin Walzer
On 12/20/11 7:31 PM, Rick Johnson wrote: Anything before Python 3.0 is now obsolete. We are currently at 3.2.2 for a stable release. 2.7 is still a supported production release of Python. It has not been end-of-lifed. -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http://mail.py

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Tom Davis
On Dec 21, 2011, at 2:15 AM, Chris Withers wrote: > Hi All, > > What's the general consensus on supporting Python 2.5 nowadays? > > Do people still have to use this in commercial environments or is everyone on > 2.6+ nowadays? For those of us living the nightmare of AppEngine *and* working

Re: Why widgets become 'NoneType'?

2011-12-21 Thread Dave Angel
On 12/21/2011 07:59 AM, Muddy Coder wrote: Hi Folks, I was driven nuts by this thing: widgets lost their attributes, then I can't configure them. Please take a look at the codes below: from Tkinter import * canvas = Canvas(width=300, height=400, bg='white') canvas.pack(expand=NO, fill=BOTH) pic

Re: Anyone still using Python 2.5?

2011-12-21 Thread Roy Smith
In article <4ef1b9fa$0$29973$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Centos and Red Hat production systems still use Python 2.4, so yes, > absolutely, 2.5 and 2.4 still need to be supported. Is Python 2.4 destined to be the next IE-6? -- http://mail.python.org/mailman/li

Why widgets become 'NoneType'?

2011-12-21 Thread Muddy Coder
Hi Folks, I was driven nuts by this thing: widgets lost their attributes, then I can't configure them. Please take a look at the codes below: from Tkinter import * canvas = Canvas(width=300, height=400, bg='white') canvas.pack(expand=NO, fill=BOTH) pic = PhotoImage(file=img) canvas.create_image(0

Re: Anyone still using Python 2.5?

2011-12-21 Thread George R. C. Silva
Em quarta-feira, 21 de dezembro de 2011 08:50:34, Steven D'Aprano escreveu: On Wed, 21 Dec 2011 07:15:46 +, Chris Withers wrote: Hi All, What's the general consensus on supporting Python 2.5 nowadays? Do people still have to use this in commercial environments or is everyone on 2.6+ nowad

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Jim Fulton
On Wed, Dec 21, 2011 at 2:15 AM, Chris Withers wrote: > Hi All, > > What's the general consensus on supporting Python 2.5 nowadays? > > Do people still have to use this in commercial environments or is everyone > on 2.6+ nowadays? > > I'm finally getting some continuous integration set up for my p

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Jonathan Lange
On Wed, Dec 21, 2011 at 9:21 AM, Pierre-Yves David wrote: ... > The most notable exception is Ubuntu Hardy and LTS release from april 2008 > with > 2.5. But this LTS is out of support for almost 1 year now and current LTS > (Lucid) ship 2.6. Not quite. Ubuntu 8.04 LTS is supported on the server

Re: Anyone still using Python 2.5?

2011-12-21 Thread Steven D'Aprano
On Wed, 21 Dec 2011 07:15:46 +, Chris Withers wrote: > Hi All, > > What's the general consensus on supporting Python 2.5 nowadays? > > Do people still have to use this in commercial environments or is > everyone on 2.6+ nowadays? Centos and Red Hat production systems still use Python 2.4, s

RE: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Staple, Daniel (BSKYB)
We've a bunch of windows servers stuck on python 2.5 since an API we use on them is shipped to us pyc's only - forcing us to stay with that version. Most of our other machines are on 2.6 or 2.7. -Original Message- From: testing-in-python-boun...@lists.idyll.org [mailto:testing-in-pytho

Re: Learning Python 2.4

2011-12-21 Thread DJC
On 21/12/11 02:13, Ashton Fagg wrote: > I got the impression the OP was learning programming in general (i.e. > from scratch) and not merely "learning Python". If this is the case it > shouldn't matter if they're merely learning the concepts as you can > always get up to speed on the differences l

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Pierre-Yves David
On Wed, Dec 21, 2011 at 07:15:46AM +, Chris Withers wrote: > Hi All, > > What's the general consensus on supporting Python 2.5 nowadays? > > Do people still have to use this in commercial environments or is > everyone on 2.6+ nowadays? > > I'm finally getting some continuous integration set

Can I get use pexpect to control this process?

2011-12-21 Thread Saqib Ali
I have a program X that constantly spews output, hundreds of lines per minute. X is not an interactive program. IE: it doesn't take any user input. It just produces a lot of textual output to STDOUT. I would like to save the output produced by X into a different file every 5 seconds regardless of

Re: Anyone still using Python 2.5?

2011-12-21 Thread Stefan Behnel
Chris Withers, 21.12.2011 08:15: What's the general consensus on supporting Python 2.5 nowadays? From my own (recent) polls, it appears that people want continued support for Python 2.4 and later for a couple of years to come, mainly because RHEL5 uses that by default and has official support

Anyone still using Python 2.5?

2011-12-21 Thread Chris Withers
Hi All, What's the general consensus on supporting Python 2.5 nowadays? Do people still have to use this in commercial environments or is everyone on 2.6+ nowadays? I'm finally getting some continuous integration set up for my packages and it's highlighting some 2.5 compatibility issues. I'm