Re:Web framework

2013-11-21 Thread jj
bottle webpy flask ? what does "better" means ? -- Original -- From: "Renato Barbosa Pim Pereira";; Date: Fri, Nov 22, 2013 02:15 PM To: "python list"; Subject: Web framework I'm thinking of porting a Python application that uses numpy for web, basically

Web framework

2013-11-21 Thread Renato Barbosa Pim Pereira
I'm thinking of porting a Python application that uses numpy for web, basically would like to upload a user-defined data, perform the calculations with numpy and plot charts with the general structure of a site such as a blog for example, I have studied a bit of django and web2py, but I wonder if t

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread rusi
On Friday, November 22, 2013 11:02:43 AM UTC+5:30, Steven D'Aprano wrote: > To a fluent Python programmer, that's what semi-colons are like, although > to a lesser degree. An unnecessary distraction and annoyance, rather like > people who talk like this: > "Er, I prefer, um, using the semicolon

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread Steven D'Aprano
On Thu, 21 Nov 2013 18:36:32 -0800, Cilantro MC wrote: > I prefer using the semicolons... They aren't making my code wrong... I > use other programming languages from time to time, and I'd rather just > always use semicolons, as with the parentheses. There are all sorts of things that you can do

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread Chris Angelico
On Fri, Nov 22, 2013 at 3:02 PM, Gregory Ewing wrote: > Cilantro MC wrote: >> >> I prefer using the semicolons... They aren't making my code wrong... I use >> other programming languages from time to time, and I'd rather just always >> use >> semicolons, as with the parentheses. > > > It's your ch

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Gary Herron
On 11/21/2013 03:55 PM, bradleybooth12...@gmail.com wrote: the problem i have is that it's just giving me the first number of the sequence not the actual sequence Not when I run it. After correcting the indentation errors, I get the correct sequence *except* that it's missing the first numbe

Re: Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread Chris Angelico
On Fri, Nov 22, 2013 at 2:57 PM, John Ladasky wrote: > or, for that matter, why data needs to be pickled to pass it between > processes. Oh, that part's easy. Let's leave the multiprocessing module out of it for the moment; imagine you spin up two completely separate instances of Python. Create

Re: Off-topic: Pop culture references [was Re: Newbie - Trying to Help a Friend]

2013-11-21 Thread Gregory Ewing
Tim Golden wrote: One of the (occasionally humbling) effects of internet communication is the realisation that the pop-culture reference you assumed would be instantly shared and understood by *any normal person anywhere* is, in fact, confined to your own back yard. Obviously we need a mail/new

Re: using getattr/setattr for local variables in a member function

2013-11-21 Thread Gregory Ewing
Catherine M Moroney wrote: is there some way to use getattr/setattr to access the local variables specific to a given function? No, because those variables don't even exist when there isn't a call to the function in progress. Your example suggests that, instead of local variables, you really

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread Gregory Ewing
Cilantro MC wrote: I prefer using the semicolons... They aren't making my code wrong... I use other programming languages from time to time, and I'd rather just always use semicolons, as with the parentheses. It's your choice, but just be aware that other Python programmers reading your code wi

Re: Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread John Ladasky
On Thursday, November 21, 2013 2:32:08 PM UTC-8, Ethan Furman wrote: > Check out bugs.python.org. Search for multiprocessing and tracebacks to see > if anything is already there; if not, create a new issue. And on Thursday, November 21, 2013 2:37:13 PM UTC-8, Terry Reedy wrote: > 1. Use 3.3.3

Re: using getattr/setattr for local variables in a member function

2013-11-21 Thread Ethan Furman
On 11/21/2013 06:02 PM, Dave Angel wrote: Catherine Moroney wrote: If I have a class that has some member functions, and all the functions define a local variable of the same name (but different type), is there some way to use getattr/setattr to access the local variables specific to a given fu

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread Ned Batchelder
On Thursday, November 21, 2013 9:36:32 PM UTC-5, Cilantro MC wrote: > On Thursday, November 21, 2013 9:33:13 PM UTC-5, Roy Smith wrote: > > In article <9e773107-5a6c-486b-bef2-186101d8f...@googlegroups.com>, > > cilantr...@gmail.com wrote: > > > > > I'm attempting to set up an extremely simple se

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread Roy Smith
In article , Cilantro MC wrote: > > First thing, get rid of all those semicolons. This is Python you're > > > > writing, not C++. Likewise, the extra parens in your while statements. > > > > > > > > Your problem is that you're doing the accept() inside your main loop on > > > > the serv

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread Cilantro MC
On Thursday, November 21, 2013 9:33:13 PM UTC-5, Roy Smith wrote: > In article <9e773107-5a6c-486b-bef2-186101d8f...@googlegroups.com>, > > cilantr...@gmail.com wrote: > > > > > I'm attempting to set up an extremely simple server that receives a string, > > > and returns a string. However, I

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread Roy Smith
In article <9e773107-5a6c-486b-bef2-186101d8f...@googlegroups.com>, cilantr...@gmail.com wrote: > I'm attempting to set up an extremely simple server that receives a string, > and returns a string. However, I have 2 problems. I'm able to receive the > string from the client fine, but it only wi

Re: Recursive generator for combinations of a multiset?

2013-11-21 Thread James
On Thursday, November 21, 2013 5:01:15 AM UTC-8, John O'Hagan wrote: > On Thu, 21 Nov 2013 11:42:49 + > > Oscar Benjamin wrote: > > > > > On 21 November 2013 06:46, John O'Hagan > > > wrote: > > > > > > > > I found a verbal description of such an algorithm and came up with > > > > thi

Re: using getattr/setattr for local variables in a member function

2013-11-21 Thread Dave Angel
On Fri, 22 Nov 2013 00:52:21 +, MRAB wrote: > If I have a class that has some member functions, and all the functions > define a local variable of the same name (but different type), is there > some way to use getattr/setattr to access the local variables specific > to a given function

Re: using getattr/setattr for local variables in a member function

2013-11-21 Thread Ned Batchelder
On Thursday, November 21, 2013 6:12:10 PM UTC-5, Catherine M Moroney wrote: > Hello, > > If I have a class that has some member functions, and all the functions > define a local variable of the same name (but different type), is there > some way to use getattr/setattr to access the local variable

Having trouble setting up an extremely simple server...

2013-11-21 Thread cilantromc
I'm attempting to set up an extremely simple server that receives a string, and returns a string. However, I have 2 problems. I'm able to receive the string from the client fine, but it only will receive it once. After I send another string from the client, it doesn't come up on the server... Al

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Terry Reedy
On 11/21/2013 6:55 PM, bradleybooth12...@gmail.com wrote: the problem i have is that it's just giving me the first number of the sequence not the actual sequence Please show actually copy/pasted input and output. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: using getattr/setattr for local variables in a member function

2013-11-21 Thread MRAB
On 21/11/2013 23:12, Catherine M Moroney wrote: Hello, If I have a class that has some member functions, and all the functions define a local variable of the same name (but different type), is there some way to use getattr/setattr to access the local variables specific to a given function? Obvi

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Terry Reedy
On 11/21/2013 6:17 PM, bradleybooth12...@gmail.com wrote: Coming back to the second question "The collatz process is as follows. Take a positive integer n greater than 1. while n is greater than 1 repeat the following; if N is even halve it and if N is odd multiply it by 3 and add 1. The (Uns

using getattr/setattr for local variables in a member function

2013-11-21 Thread Catherine M Moroney
Hello, If I have a class that has some member functions, and all the functions define a local variable of the same name (but different type), is there some way to use getattr/setattr to access the local variables specific to a given function? Obviously there's no need to do this for the small

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread bradleybooth12345
the problem i have is that it's just giving me the first number of the sequence not the actual sequence -- https://mail.python.org/mailman/listinfo/python-list

Re: how to deal with deprecating API functionality in python module?

2013-11-21 Thread Ben Finney
Chris Angelico writes: > 1) Keep deprecated APIs around for as long as you can, even if they're > implemented messily on top of your current API. > > 2) Design your API with future-proofing in mind. 2.1) Have a generous deprecation schedule, and go to significant lengths to ensure all developers

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Gary Herron
On 11/21/2013 03:17 PM, bradleybooth12...@gmail.com wrote: Coming back to the second question "The collatz process is as follows. Take a positive integer n greater than 1. while n is greater than 1 repeat the following; if N is even halve it and if N is odd multiply it by 3 and add 1. The (Uns

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread bradleybooth12345
Coming back to the second question "The collatz process is as follows. Take a positive integer n greater than 1. while n is greater than 1 repeat the following; if N is even halve it and if N is odd multiply it by 3 and add 1. The (Unsolved) collatz conjecture is that this process always termi

Re: Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread Terry Reedy
On 11/21/2013 12:01 PM, John Ladasky wrote: This is a case where you need to dig into the code (or maybe docs) a bit File ".../evaluate.py", line 81, in evaluate > result = pool.map(evaluate, bundles) File "/usr/lib/python3.3/multiprocessing/pool.py", line 228, in map > return self._map_

Re: Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread Ethan Furman
On 11/21/2013 01:49 PM, John Ladasky wrote: So now, for anyone who is still reading this: is it your opinion that the traceback that I obtained through multiprocessing.pool._map_async().get() SHOULD have allowed me to see what the ultimate cause of the exception was? It would certainly be ni

Re: Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread John Ladasky
Followup: I didn't need to go as far as Chris Angelico's second suggestion. I haven't looked at certain parts of my own code for a while, but it turns out that I wrote it REASONABLY logically... My evaluate() calls another function through pool.map_async() -- _evaluate(), which actually proce

Re: Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread John Ladasky
On Thursday, November 21, 2013 12:53:07 PM UTC-8, Chris Angelico wrote: > What you could try is Suggestion 1: > printing out the __cause__ and __context__ of > the exception, to see if there's anything useful in them; Suggestion 2: > if there's > nothing, the next thing to try would be some

Re: Recursive generator for combinations of a multiset?

2013-11-21 Thread John O'Hagan
On Thu, 21 Nov 2013 11:42:49 + Oscar Benjamin wrote: > On 21 November 2013 06:46, John O'Hagan > wrote: > > > > I found a verbal description of such an algorithm and came up with > > this: > > > > def multicombs(it, r): > > result = it[:r] > > yield result > > while 1: > >

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Chris Angelico
On Thu, Nov 21, 2013 at 10:53 PM, Antoon Pardon wrote: > Op 20-11-13 19:09, Mark Lawrence schreef: >> I suggest that you write to the BBC and get all episodes of the >> extremely popular *COMEDY* "Dad's Army" withdrawn as "typical shabby >> Nazi trick" was one of Captain Mainwearing's main lines.

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Antoon Pardon
Op 20-11-13 19:09, Mark Lawrence schreef: > On 20/11/2013 17:51, Ned Batchelder wrote: >> On Wednesday, November 20, 2013 12:37:31 PM UTC-5, Mark Lawrence wrote: >>> On 20/11/2013 17:12, Ned Batchelder wrote: Nazi? Perhaps we could stick to more appropriate analogies? --Ned. >>

Re: Recursive generator for combinations of a multiset?

2013-11-21 Thread Dan Stromberg
On Wed, Nov 20, 2013 at 10:46 PM, John O'Hagan wrote: > > Short story: the subject says it all, so if you have an answer already, > fire away. Below is the long story of what I'm using it for, and why I > think it needs to be recursive. It may even be of more general > interest in terms of filteri

Re: Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread Chris Angelico
On Fri, Nov 22, 2013 at 5:25 AM, John Ladasky wrote: > On Thursday, November 21, 2013 9:24:33 AM UTC-8, Chris Angelico wrote: > >> Hmm. This looks like a possible need for the 'raise from' syntax. > > Thank you, Chris, that made me feel like a REAL Python programmer -- I just > did some reading,

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Neil Cerutti
On Thu, Nov 21, 2013 at 10:48 AM, Chris Angelico wrote: > Well, a good British comedy does go around a long way. I have to say, > though, the shortness of the line makes it harder to recognize. Only > in the tightest of circles could one say "Bother that telephone!" and > have people understand th

Re: Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread Chris Angelico
On Fri, Nov 22, 2013 at 4:01 AM, John Ladasky wrote: > Here is the end of the traceback, starting with the last line of my code: > "result = pool.map(evaluate, bundles)". After that, I'm into Python itself. > > File ".../evaluate.py", line 81, in evaluate > result = pool.map(evaluate, bund

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Anssi Saari
Dennis Lee Bieber writes: > Does Pan have an option to generate its own Message-ID header? > > Headers seem to indicate multiple injections somewhere Perhaps Pan doesn't? Someone else had multipostings in the Android group but he was posting via aioe. -- https://mail.python.org/mail

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Chris Angelico
On Fri, Nov 22, 2013 at 3:29 AM, Neil Cerutti wrote: > Many of the main villains in > the book are hilarious and mean-spirited parodies of > a series of British children's literature, The Wombles, > and a British TV show, Steptoe and Son, but the characters work > fine on their own. Yeah, that's

Re: Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread John Ladasky
On Thursday, November 21, 2013 9:24:33 AM UTC-8, Chris Angelico wrote: > Hmm. This looks like a possible need for the 'raise from' syntax. Thank you, Chris, that made me feel like a REAL Python programmer -- I just did some reading, and the "raise from" feature was not implemented until Python

Traceback when using multiprocessing, less than helpful?

2013-11-21 Thread John Ladasky
Hi folks, Somewhat over a year ago, I struggled with implementing a routine using multiprocessing.Pool and numpy. I eventually succeeded, but I remember finding it very hard to debug. Now I have managed to provoke an error from that routine again, and once again, I'm struggling. Here is the

Re: Recursive generator for combinations of a multiset?

2013-11-21 Thread Oscar Benjamin
On 21 November 2013 06:46, John O'Hagan wrote: > > I found a verbal description of such an algorithm and came up with > this: > > def multicombs(it, r): > result = it[:r] > yield result > while 1: > for i in range(-1, -r - 1, -1): > rep = result[i] > if

Re: Off-topic: Pop culture references [was Re: Newbie - Trying to Help a Friend]

2013-11-21 Thread Chris Angelico
On Thu, Nov 21, 2013 at 8:08 PM, Tim Golden wrote: > Of course, if some were to say "My name is Inigo Montoya; you killed my > father; prepare to die"... You killfiled my address - prepare to be ignored! ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Off-topic: Pop culture references [was Re: Newbie - Trying to Help a Friend]

2013-11-21 Thread Tim Golden
On 21/11/2013 00:27, Steven D'Aprano wrote: > I fully support the right of everyone to make cryptic references to > movies, television shows, science fiction and fantasy novels, internet > memes, and assorted pop culture references. One of the (occasionally humbling) effects of internet communi

Re: zip list, variables

2013-11-21 Thread Peter Otten
flebber wrote: > Thank you for the replies. > > Looking at the replies I am wondering which solution is more scalable. At > the moment it is only 2 nested lists but what about 5, 10, 20 or more? > > Should I start looking into numpy to handle this or will list > comprehension > >>> [ [ x + y f