Diez B. Roggisch wrote:
Alex Jurkiewicz schrieb:
Hi all,
I'm writing a Python script to do a "mail merge" style email
distribution. I create a few python threads and in each one I call
`smtpserver = smtplib.SMTP(our.smtpserver.com)`. However, during the
sending process, there seems to be only
Alexzive wrote:
Hello,
I have this matrix [20*4 - but it could be n*4 , with n~100,000] in
file "EL_list" like this:
1, 1, 2, 3
2, 4, 1, 5
3, 5, 1, 6
4, 7, 5, 6
5, 8, 7, 9
6, 8, 5,
Snorri H wrote:
> On May 4, 5:04 am, Matthew Wilson wrote:
>> Is there already a tool in the standard library to let me walk up from a
>> subdirectory to the top of my file system?
>
>
> Never seen such a standard tool, yet it can be implemented in a way
> like this
>
> def walkup(path):
>
Alessandro wrote:
On May 4, 2:38 pm, Alexzive wrote:
Hello,
I have this matrix [20*4 - but it could be n*4 , with n~100,000] in
file "EL_list" like this:
1, 1, 2, 3
2, 4, 1, 5
3, 5, 1, 6
4, 7, 5, 6
5,
On Monday 04 May 2009 04:01:23 am Hendrik van Rooyen wrote:
> This will form a virtual (or real if you have different machines)
> systolic array with producers feeding consumers that feed
> the summary process, all running concurrently.
Nah, I can't do that. The summary process is expensive, but
Hello all,
I've been spending the last few days experimenting with Tkinter. The
grid manager is nice and easy to use, but I have found that I am often
having to specify padx and pady options to every widget I add to my
grid. The way I am doing it is to create a dictionary:
paddding = {'padx': '1m
Hi,
I am using pylons web framework for my server. I need to get the ip address
of the client machine which made a request to the server in my python code.
How can I do that, I am new to pylons and the existing server has so many
applications. looking forward to get some solutions from the kind fr
On Mon, May 4, 2009 at 3:01 PM, John O'Hagan wrote:
> On Mon, 4 May 2009, Matthias Gallé wrote:
> > Hi.
> >
> > My problem is to replace all occurrences of a sublist with a new element.
> >
> > Example:
> > Given ['a','c','a','c','c','g','a','c'] I want to replace all
> > occurrences of ['a','c']
On Mon, 4 May 2009, Matthias Gallé wrote:
> Hi.
>
> My problem is to replace all occurrences of a sublist with a new element.
>
> Example:
> Given ['a','c','a','c','c','g','a','c'] I want to replace all
> occurrences of ['a','c'] by 6 (result [6,6,'c','g',6]).
>
li=['a', 'c', 'a', 'c', 'c', 'g', '
Matthias Gallé:
> My problem is to replace all occurrences of a sublist with a new element.
> Example:
> Given ['a','c','a','c','c','g','a','c'] I want to replace all
> occurrences of ['a','c'] by 6 (result [6,6,'c','g',6]).
There are several ways to solve this problem. Representing a string as
a
On May 4, 2:38 pm, Alexzive wrote:
> Hello,
> I have this matrix [20*4 - but it could be n*4 , with n~100,000] in
> file "EL_list" like this:
>
> 1, 1, 2, 3
> 2, 4, 1, 5
> 3, 5, 1, 6
> 4, 7, 5, 6
> 5, 8,
Hello,
I have this matrix [20*4 - but it could be n*4 , with n~100,000] in
file "EL_list" like this:
1, 1, 2, 3
2, 4, 1, 5
3, 5, 1, 6
4, 7, 5, 6
5, 8, 7, 9
6, 8, 5, 7
7,
2009/5/4 :
> An idea-syntax:
>
> def fact(n):
> return 1 if n <= 1 else n * inspect.self(n - 1)
>
> Or even a lambda, because you don't need the name anymore to call the
> function:
>
> fact = lambda n: 1 if n <= 1 else n * self(n - 1)
How would it work with methods?
class Foo:
def fac(se
Hi.
My problem is to replace all occurrences of a sublist with a new element.
Example:
Given ['a','c','a','c','c','g','a','c'] I want to replace all
occurrences of ['a','c'] by 6 (result [6,6,'c','g',6]).
If I do this with string ('acaccgac') I have the advantage of all the
'find' functions,
On Wed, 15 Apr 2009 22:45:35 +, Benjamin Peterson wrote:
> Why do you think you're wasting time with 2.x?
I'm a relative newbie to python as well but I'd agree that there is at
least a small degree of time "wasted" learning python 2.x simply because
the standard library of python 3.x has been
On May 4, 5:04 am, Matthew Wilson wrote:
> Is there already a tool in the standard library to let me walk up from a
> subdirectory to the top of my file system?
Never seen such a standard tool, yet it can be implemented in a way
like this
def walkup(path):
aux = path.rsplit('/')
while a
On Mon, May 4, 2009 at 2:33 AM, namekuseijin
wrote:
ls = [(1,2), (3,4), (5, None), (6,7), (8, None)]
[(x,y) for (x,y) in ls if y]
> [(1, 2), (3, 4), (6, 7)]
Nope. That filters out 0 as well as None. Not what the OP asked for.
--
http://mail.python.org/mailman/listinfo/python-list
Snorri H writes:
> On May 3, 6:13 am, Ross wrote:
>> I'm trying to set up a simple filter using a list comprehension. If I
>> have a list of tuples, a = [(1,2), (3,4), (5,None), (6,7), (8, None)]
>> and I wanted to filter out all tuples containing None, I would like to
>> get the new list b = [(
On May 3, 6:13 am, Ross wrote:
> I'm trying to set up a simple filter using a list comprehension. If I
> have a list of tuples, a = [(1,2), (3,4), (5,None), (6,7), (8, None)]
> and I wanted to filter out all tuples containing None, I would like to
> get the new list b = [(1,2), (3,4),(6,7)].
>
> I
Diez B. Roggisch wrote:
> Alex Jurkiewicz wrote:
>
>> Gabriel Genellina wrote:
>>> Try logging the start/stop of your threads. It may be that your
>>> threads stop before you think. The above code works correctly only if
>>> you fill the queue before starting any thread - because as soon as a
>>>
Alex Jurkiewicz wrote:
> Gabriel Genellina wrote:
>> Try logging the start/stop of your threads. It may be that your
>> threads stop before you think. The above code works correctly only if
>> you fill the queue before starting any thread - because as soon as a
>> thread sees the queue empty, it f
Arnaud Delobelle:
> >>> def bindfunc(f):
> ... def boundf(*args, **kwargs):
> ... return f(boundf, *args, **kwargs)
> ... return boundf
> ...>>> @bindfunc
> ... def fac(self, n):
> ... return 1 if n <= 1 else n * self(n - 1)
> ...>>> fac(5)
> 120
This is cute, now I have two n
CTO wrote:
>> In addition, the zip file format stores the directory at the end of the
>> file. So you can't process it until it's completely downloaded.
>> Concurrency doesn't help here.
>
> Don't think that's relevant, if I'm understanding the OP correctly.
> Lets say you've downloaded the file
Gabriel Genellina wrote:
Try logging the start/stop of your threads. It may be that your
threads stop before you think. The above code works correctly only if
you fill the queue before starting any thread - because as soon as a
thread sees the queue empty, it finishes.
You could use the sample
Steven D'Aprano writes:
> I don't understand why my recursive function hits the recursion
> limit inside the timeit.Timer when it works outside of it.
Probably because your test function is at the very edge of the
recursion limit, and timeit.Timer triggers it because it calls it at a
deeper stac
"Luis Alberto Zarrabeitia Gomez" wrote:
>Quoting Hendrik van Rooyen :
>> In fact I happen to believe that anything that does any work needs
>> one and only one input queue and nothing else, but I am peculiar
>> that way.
>
>Well, I also need some output. In my case, the outputs are files with th
En Mon, 04 May 2009 04:19:21 -0300, Alex Jurkiewicz
escribió:
Diez B. Roggisch wrote:
Without more code, it's impossible to tell if there is anything
peculiar in your usage of the lib. Maybe you close your connections to
fast to see several open?
Here's the relevant stuff from my (python2
"norseman" wrote:
> There has to be some way of using a Message or Label (or some) widget as
> a simple posting board.
There is - look at textvariable - an instance of StringVar that is associated
with
the widget.
If all else fails, you can always use configure to change the text...
hth - He
Diez B. Roggisch wrote:
Without more code, it's impossible to tell if there is anything
peculiar in your usage of the lib. Maybe you close your connections to
fast to see several open?
Here's the relevant stuff from my (python2.6) code:
CONCURRENCY = 3
def threadProcessRecipient():
# Eac
On Apr 16, 1:26 pm, Brendon Wickham wrote:
> I agree, no IDE needed. Just don't use Notepad! I'm on Mac, so
> spoiled for choice of text editors, but I'm sure there's one
> or 2 good uns if you're on Windows.
The Zeus for Windows IDE is Python aware:
http://www.zeusedit.com/python.html
It d
En Sun, 03 May 2009 21:41:47 -0300, Deep_Feelings
escribió:
Do you think python online docs are good starting point for me? ( i
experience with other programming languages ) or should i get giant
book or something ?
If you have some previous experience with other languages, I think that
"
101 - 131 of 131 matches
Mail list logo