On Fri, Oct 4, 2013 at 9:15 AM, Dennis Lee Bieber wrote:
> On Thu, 3 Oct 2013 10:25:47 +1000, Chris Angelico
> declaimed the following:
>
>>On Thu, Oct 3, 2013 at 9:47 AM, Dennis Lee Bieber
>>wrote:
>>> try:
>>> numItems = int(raw_input("\n\nHow many values? "))
>>> except:
On Fri, Oct 4, 2013 at 12:14 AM, MRAB wrote:
> On 03/10/2013 17:11, Mohan L wrote:
>
>> Dear All,
>>
>> I have two list of dictionaries like below:
>>
>> In the below dictionaries the value of ip can be either hostname or ip
>> address.
>>
>> output1=[
>> {'count': 3 , 'ip': 'xxx.xx.xxx.1'},
>> {
On Thu, 03 Oct 2013 10:09:25 -0400, random832 wrote:
> Speaking of assumptions, I would almost say that we should make the
> assumption that operators (other than the __i family, and
> setitem/setattr/etc) are not intended to have visible side effects. This
> would open a _huge_ field of potential
On Thu, 03 Oct 2013 17:31:44 +0530, Ravi Sahni wrote:
> On Thu, Oct 3, 2013 at 5:05 PM, Steven D'Aprano
> wrote:
>> No, you are welcome here. You've posted more in just a few days than
>> Walter has in months. We need more people like you.
>
> Thanks for the welcome!
>
> But No thanks for the
On 10/03/2013 05:18 PM, Ben Finney wrote:
random...@fastmail.us writes:
Hey, while we're on the subject, can we talk about frozen(set|dict)
literals again? I really don't understand why this discussion fizzles
out whenever it's brought up on python-ideas.
Can you start us off by searching for
On Wed, 02 Oct 2013 22:41:00 -0400, Terry Reedy wrote:
> I am referring to constant-value objects included in the code object.
> >>> def f(): return (1,2,3)
>
> >>> f.__code__.co_consts
> (None, 1, 2, 3, (1, 2, 3))
Okay, now that's more clear. I didn't understand what you meant before.
So lon
random...@fastmail.us writes:
> Hey, while we're on the subject, can we talk about frozen(set|dict)
> literals again? I really don't understand why this discussion fizzles
> out whenever it's brought up on python-ideas.
Can you start us off by searching for previous threads discussing it,
and sum
On Fri, Oct 4, 2013 at 5:53 AM, Roy Smith wrote:
> So, I think my original statement:
>
>> if you're looking for a short answer, I'd say just keep doing what
>> you're doing using multiple processes and don't get into threading.
>
> is still good advice for somebody who isn't sure they need thread
On Thursday, May 16, 2013 11:15:45 AM UTC-7, vispha...@gmail.com wrote:
> www.prevayler.org in python = pypersist
>
>
>
> medusa = python epoll web server and ftp server eventy and async
wow interesting
sprevayler ??
cl-prevalence
--
https://mail.python.org/mailman/listinfo/python-list
In article ,
Chris Angelico wrote:
> As to your corrupt data example, though, I'd advocate a very simple
> system of object ownership: as soon as the object has been put on the
> queue, it's "owned" by the recipient and shouldn't be mutated by
> anyone else.
Well, sure. I agree with you that t
On 03/10/2013 20:26, Terry Reedy wrote:
On 10/3/2013 1:42 PM, jshra...@gmail.com wrote:
I have some rather complex code that works perfectly well if I paste
it in by hand to ipython, but if I use %run it can't find some of the
libraries, but others it can.
Ipython is a separate product built o
On 10/3/2013 1:42 PM, jshra...@gmail.com wrote:
I have some rather complex code that works perfectly well if I paste it in by
hand to ipython, but if I use %run it can't find some of the libraries, but
others it can.
Ipython is a separate product built on top of Python. If no answer here,
lo
On 10/2/2013 10:34 PM, Steven D'Aprano wrote:
You are both assuming that LOAD_CONST will re-use the same tuple
(1, 2, 3) in multiple places.
No I did not. To save tuple creation time, a pre-compiled tuple is
reused when its display expression is re-executed. If I had been
interested in multi
On 03/10/2013 17:11, Mohan L wrote:
Dear All,
I have two list of dictionaries like below:
In the below dictionaries the value of ip can be either hostname or ip
address.
output1=[
{'count': 3 , 'ip': 'xxx.xx.xxx.1'},
{'count': 4, 'ip': 'xxx.xx.xxx.2'},
{'count': 8, 'ip': 'xxx.xx.xxx.3'},
{'cou
On 3/10/2013 12:50, Chris Angelico wrote:
> On Fri, Oct 4, 2013 at 2:41 AM, Roy Smith wrote:
>> The downside to threads is that all of of this sharing makes them much
>> more complicated to use properly. You have to be aware of how all the
>> threads are interacting, and mediate access to shared
On Fri, Oct 4, 2013 at 4:28 AM, Roy Smith wrote:
> Well, the GIL certainly eliminates a whole range of problems, but it's
> still possible to write code that deadlocks. All that's really needed
> is for two threads to try to acquire the same two resources, in
> different orders. I'm running the
In article ,
Chris Angelico wrote:
> On Fri, Oct 4, 2013 at 2:41 AM, Roy Smith wrote:
> > The downside to threads is that all of of this sharing makes them much
> > more complicated to use properly. You have to be aware of how all the
> > threads are interacting, and mediate access to shared r
On 03/10/2013 18:37, 李洛 wrote:
Hi list,
I write an example script using threading as follow.
It look like hang when the list l_ip is empty. And any suggestion with
debug over the threading in Python ?
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 import re
4 import os
5 impo
On Thursday, October 3, 2013 11:03:17 AM UTC-7, Neil Cerutti wrote:
> On 2013-10-03, trip...@gmail.com wrote:
>
> > thekey=[{"a": 80.0, "b": 0.0, "c": 10.0, "d": 10.0}, {"a":
>
> > 100.0, "b": 0.0, "c": 0.0, "d": 0.0}, {"a": 80.0, "b": 0.0,
>
> > "c": 10.0, "d": 10.0}, {"a": 90.0, "b": 0.0, "c"
Here's the answer:
from enthought.traits.api import HasTraits, Str, List, Button, Any
from enthought.traits.ui.api import View, Item
from enthought.traits.ui.api import ListEditor
class A(HasTraits):
StringA = Str
view = View(Item('StringA'))
class B(HasTraits):
StringB = Str
view
On 2013-10-03, trip...@gmail.com wrote:
> thekey=[{"a": 80.0, "b": 0.0, "c": 10.0, "d": 10.0}, {"a":
> 100.0, "b": 0.0, "c": 0.0, "d": 0.0}, {"a": 80.0, "b": 0.0,
> "c": 10.0, "d": 10.0}, {"a": 90.0, "b": 0.0, "c": 0.0, "d":
> 10.0}]
>
> However, at the URL, the values show up as 90.4327869412
Hi list,
I write an example script using threading as follow.
It look like hang when the list l_ip is empty. And any suggestion with
debug over the threading in Python ?
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 import re
4 import os
5 import threading
6 from Queue import Que
Dear All,
I have two list of dictionaries like below:
In the below dictionaries the value of ip can be either hostname or ip
address.
output1=[
{'count': 3 , 'ip': 'xxx.xx.xxx.1'},
{'count': 4, 'ip': 'xxx.xx.xxx.2'},
{'count': 8, 'ip': 'xxx.xx.xxx.3'},
{'count': 10, 'ip': 'xxx.xx.xxx.4'},
{'coun
On 10/03/2013 09:12 AM, macker wrote:
Hi, hope this is the right group for this:
I miss two basic (IMO) features in parallel processing:
1. make `threading.Thread.start()` return `self`
I'd like to be able to `workers = [Thread(params).start() for params in
whatever]`. Right now, it's 5 ugly,
I have some rather complex code that works perfectly well if I paste it in by
hand to ipython, but if I use %run it can't find some of the libraries, but
others it can. The confusion seems to have to do with mathplotlib. I get it in
stream by:
%pylab osx
and do a bunch of stuff interactivel
trip...@gmail.com wrote:
> On Wednesday, October 2, 2013 10:01:16 AM UTC-7, tri...@gmail.com wrote:
>> am trying to round off values in a dict to 2 decimal points but have been
>> unsuccessful so far. The input I have is like this:
>>
>>
>>
>>
>>
>> y = [{'a': 80.0, 'b': 0.0786235, 'c': 1
On Wed, Oct 2, 2013 at 10:46 AM, rusi wrote:
> 4. There is a whole spectrum of such optimizaitons --
> 4a eg a single-call structural recursion example, does not need to push
> return address on the stack. It only needs to store the recursion depth:
>
> If zero jump to outside return add; if > 0 j
On Wednesday, October 2, 2013 10:01:16 AM UTC-7, tri...@gmail.com wrote:
> am trying to round off values in a dict to 2 decimal points but have been
> unsuccessful so far. The input I have is like this:
>
>
>
>
>
> y = [{'a': 80.0, 'b': 0.0786235, 'c': 10.0, 'd': 10.6742903}, {'a':
> 80.
On Fri, Oct 4, 2013 at 2:41 AM, Roy Smith wrote:
> The downside to threads is that all of of this sharing makes them much
> more complicated to use properly. You have to be aware of how all the
> threads are interacting, and mediate access to shared resources. If you
> do that wrong, you get mem
On Fri, Oct 4, 2013 at 2:01 AM, JL wrote:
> What is the difference between running multiple python scripts and a single
> multi-threaded script? May I know what are the pros and cons of each
> approach? Right now, my preference is to run multiple separate python scripts
> because it is simpler.
On Fri, Oct 4, 2013 at 2:42 AM, Tim Chase wrote:
> Do you mean
>
> workers = [Thread(params) for params in whatever]
> for thrd in workers: thrd.start()
>
> ? ("Thread(params)" vs. "Thread(params).start()" in your list comp)
Whoops, copy/paste fail. Yes, that's what I meant.
Thanks for catc
On 2013-10-04 02:21, Chris Angelico wrote:
> > workers = []
> > for params in whatever:
> > thread = threading.Thread(params)
> > thread.start()
> > workers.append(thread)
>
> You could shorten this by iterating twice, if that helps:
>
> worke
In article ,
JL wrote:
> What is the difference between running multiple python scripts and a single
> multi-threaded script? May I know what are the pros and cons of each
> approach? Right now, my preference is to run multiple separate python scripts
> because it is simpler.
First, let's ta
On Fri, Oct 4, 2013 at 2:12 AM, macker wrote:
> I'd like to be able to `workers = [Thread(params).start() for params in
> whatever]`. Right now, it's 5 ugly, menial lines:
>
> workers = []
> for params in whatever:
> thread = threading.Thread(params)
> thre
Hi, hope this is the right group for this:
I miss two basic (IMO) features in parallel processing:
1. make `threading.Thread.start()` return `self`
I'd like to be able to `workers = [Thread(params).start() for params in
whatever]`. Right now, it's 5 ugly, menial lines:
workers = []
This list is for development OF Python, not for development in python. For
that reason, I will redirect this to python-list as well. My actual answer
is below.
On Thu, Oct 3, 2013 at 6:45 AM, Igor Vasilyev
wrote:
> Hi.
>
> Example test.py:
>
> class A():
> def __add__(self, var):
>
On 2013-10-03, Duncan Booth wrote:
>> How do know that either "<=" or "*" didn't rebind the name
>> "fact" to something else? I think that's the main reason why
>> python cannot apply any procedural optimization (even things
>> like inlining are impossible, or possible only under very
>> conservat
What is the difference between running multiple python scripts and a single
multi-threaded script? May I know what are the pros and cons of each approach?
Right now, my preference is to run multiple separate python scripts because it
is simpler.
--
https://mail.python.org/mailman/listinfo/pytho
Alain Ketterlin wrote:
> Terry Reedy writes:
>
>> Part of the reason that Python does not do tail call optimization is
>> that turning tail recursion into while iteration is almost trivial,
>> once you know the secret of the two easy steps. Here it is.
>>
>> Assume that you have already done th
On Wed, Oct 2, 2013, at 22:34, Steven D'Aprano wrote:
> You are both assuming that LOAD_CONST will re-use the same tuple
> (1, 2, 3) in multiple places. But that's not the case, as a simple test
> will show you:
>>> def f():
... return (1, 2, 3)
>>> f() is f()
True
It does, in fact, re-use it
On Wed, Oct 2, 2013, at 21:46, MRAB wrote:
> > The difference is that a tuple can be reused, so it makes sense for the
> > comiler to produce it as a const. (Much like the interning of small
> > integers) The list, however, would always have to be copied from the
> > compile-time object. So that
On Wed, Oct 2, 2013, at 17:33, Terry Reedy wrote:
> 5. Conversion of apparent recursion to iteration assumes that the
> function really is intended to be recursive. This assumption is the
> basis for replacing the recursive call with assignment and an implied
> internal goto. The programmer can
On Thu, Oct 3, 2013 at 5:05 PM, Steven D'Aprano
wrote:
> On Thu, 03 Oct 2013 09:21:08 +0530, Ravi Sahni wrote:
>
>> On Thu, Oct 3, 2013 at 2:43 AM, Walter Hurry
>> wrote:
>>> Ding ding! Nikos is simply trolling. It's easy enough to killfile him
>>> but inconvenient to skip all the answers to his
On Thu, 03 Oct 2013 09:01:29 +0200, Antoon Pardon wrote:
> You don't
> follow the principle of treating others in the way you hope to be
> treated if you were in their shoes.
[...]
> Suppose you develop a new
> interest in which you are now the newbie and you go to a newsgroup or
> forum where a
On Thu, 03 Oct 2013 09:21:08 +0530, Ravi Sahni wrote:
> On Thu, Oct 3, 2013 at 2:43 AM, Walter Hurry
> wrote:
>> Ding ding! Nikos is simply trolling. It's easy enough to killfile him
>> but inconvenient to skip all the answers to his lengthy threads. If
>> only people would just ignore him!
>
>
subhabangal...@gmail.com wrote:
> Dear Group,
>
> I am trying to work out a solution to the following problem in Python.
>
> The Problem:
> Suppose I have three lists.
> Each list is having 10 elements in ascending order.
> I have to construct one list having 10 elements which are of the lowest
On 2 October 2013 23:28, Michael Schwarz wrote:
>
> I will look into that too, that sounds very convenient. But am I right, that
> to use Cython the non-Python code needs to be written in the Cython language,
> which means I can't just copy&past C code into it? For my current project,
> this is
Hello,
Nodebox is a program in the spirit of Processing but for Python.
The first version runs only on MAC.
Tom, the creator has partly ported it to Javascript.
But many of you dislike Javascript.
The solution was to use a translator, Python -> Javascript
Of the both two greats solutions Bryth
Op 02-10-13 15:17, Steven D'Aprano schreef:
> [...]
>> And you don't treat all others in the way you hope to be treated if you
>> would be in their shoes. I suspect that should you one day feel so
>> frustrated you need to vent, you will hope to get treated differently
>> than how you treat those
49 matches
Mail list logo