Re: per-method jit compiler

2010-04-06 Thread Florian Ludwig
ts what done before by psyco: http://psyco.sourceforge.net/ No need for a decorator though. -- Florian Ludwig -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception in pydoc

2010-02-27 Thread Florian Ludwig
>>> #!/usr/bin/env python # -*- coding: utf-8 -*- def foo(): """Some ütf-8 docstring ∑ g⊙f (x)""" return False <<>> help(test) Help on module test: NAME test - # -*- coding: utf-8 -*- FILE /tmp/test.py FUNCTIONS

Re: plugin / intra process communication system

2010-02-17 Thread Florian Ludwig
On Tue, 2010-02-16 at 19:20 +0100, Diez B. Roggisch wrote: > Am 15.02.10 23:12, schrieb Florian Ludwig: > > On Sun, 2010-02-14 at 18:47 +0100, Diez B. Roggisch wrote: > >>> Here there problem with the trac (and other plugin systems I've > >> seen) > >&g

Re: plugin / intra process communication system

2010-02-16 Thread Florian Ludwig
On Tue, 2010-02-16 at 16:14 +0100, Paul Kölle wrote: > Am 15.02.2010 23:12, schrieb Florian Ludwig: > > On Sun, 2010-02-14 at 18:47 +0100, Diez B. Roggisch wrote: > >> [...] > >> And then of course, this is not really needed. In Python, behavior > >> counts,

Re: Plugin architecture

2010-02-15 Thread Florian Ludwig
or some input as well and posted some days back about a similar topic. Maybe some of the thoughts expressed there might help you as well: http://groups.google.com/group/comp.lang.python/browse_thread/thread/0a210267753919b0/5add7bc93789b418 Florian -- Florian Ludwig signature.asc Descriptio

Re: plugin / intra process communication system

2010-02-15 Thread Florian Ludwig
ttp://dpaste.com/hold/159634/ Now putting both together: > import pbus > > import wiki > import auth_openid > # or: import auth_shibboleth > > pbus.get("wiki").run() No interface definitions. What do you think? Any obvious pitfalls (besides reinventing somethi

Re: plugin / intra process communication system

2010-02-14 Thread Florian Ludwig
On Sun, 2010-02-14 at 10:16 +0100, Paul Kölle wrote: > Am 13.02.2010 10:50, schrieb Florian Ludwig: > > Hi, > > > > I'm looking for a module/plugin/intra-process-communication/hook system > > for python. Maybe someone here could point me to some project I missed &

plugin / intra process communication system

2010-02-13 Thread Florian Ludwig
Hi, I'm looking for a module/plugin/intra-process-communication/hook system for python. Maybe someone here could point me to some project I missed or might have some good ideas if I end up implementing it myself. Most systems I have found are "one to many" communications but I would like "many to

Re: Dict Comprehension ?

2008-10-07 Thread Ernst-Ludwig Brust
<[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > > from collections import defaultdict > da=defaultdict(int) > for x in [10]: >for y in [11]: >da[abs(x-y)]+=1 Thangs, collections are a real good idea. I will use this version. Ernsst-Ludwwig Brust -- http://mail.p

Re: Dict Comprehension ?

2008-10-07 Thread Ernst-Ludwig Brust
"Ben Finney" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > "Ernst-Ludwig Brust" <[EMAIL PROTECTED]> writes: > > So, generator expressions can be a powerful way to clarify the purpose > of a section of code. They can be over-used, t

Re: Dict Comprehension ?

2008-10-07 Thread Ernst-Ludwig Brust
. But, i used the idea of pruebauno, as this is faster. Ernst-Ludwig Brust -- http://mail.python.org/mailman/listinfo/python-list

Dict Comprehension ?

2008-10-06 Thread Ernst-Ludwig Brust
Given 2 Number-Lists say l0 and l1, count the various positiv differences between the 2 lists the following part works: dif=[abs(x-y) for x in l0 for y in l1] da={} for d in dif: da[d]=da.get(d,0)+1 i wonder, if there is a way, to avoid the list dif Ernst-Ludwig Brust -- http

Re: What's wrong with that comment?

2008-05-20 Thread Ludwig Miniatur
On 21 Mai, 00:12, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 20 May 2008 16:22:10 -0300, Joe P. Cool > <[EMAIL PROTECTED]> escribió: > > > > > Ludwig Miniatur wrote: > >> For example: > >> #!/usr/bin/env python > > &g

What's wrong with that comment?

2008-05-20 Thread Ludwig Miniatur
omment Looks like a little bug in parser; but what I don't understand is that I thought parser was build with the current syntax of python. So, why can python run the script (an it can if you comment out the line "ast = suite(s)") but parser can't? Looking forward for answ

Re: Python, are you ill?

2008-05-10 Thread Ludwig
This is not a bug, this is how it should work. A triple quoted string ends only with another triple quoted string (which can extend over multiple lines) In your example you are escaping the first quote character at the end of the line, thus leaving just two quotes that do not end the string. Anoth

mouse clicks in console window delayed

2006-11-24 Thread ludwig . frank
Hi, I am attempting to detect mouse clicks from within curses, using "select" on sys.stdin. It is working great within an xterm under X, but not very well in a "real" linux console. When I click my mouse while on the "real" console, nothing happens at first, even on repeated clicks. Once I press a

Re: maximum() efficency

2006-03-27 Thread Arne Ludwig
Just for completeness: The functions in Steve's original post named maximum calculate the minimum. Also, timing-wise, on my machine with a random list of 20 integers Steve's iteration version and Mitja's version are about equal, the system built-in is equal or slightly slower, and Paul's versi

Re: using regex to pull out email addresses

2006-03-25 Thread Arne Ludwig
>>> senderlist="na nu [EMAIL PROTECTED] hu [EMAIL PROTECTED] [EMAIL PROTECTED] >>> fa hu" >>> print [ s[0] for s in re.findall("(\w+@(\w+\.)+\w+)",senderlist) ] ['[EMAIL PROTECTED]', '[EMAIL PROTECTED]'] -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a loop to activate a loop above it

2006-03-23 Thread Arne Ludwig
I think the problem is this line: > x == input('What is x now?: ') which should not have a == but a = -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove integer from float number

2006-03-23 Thread Arne Ludwig
With that terse description and the subject line I would interpret the OP like so: >>> print re.sub(".*\.",".","0.666") .666 >>> print re.sub(".*\.",".","123.666") .666 -- http://mail.python.org/mailman/listinfo/python-list

Re: removing file by inode

2006-03-23 Thread Arne Ludwig
Actually under Linux he could probably pipe "clri %d" to debugfs if that is what he wanted to do. On the other hand he said "unix environment" which could be anything really. -- http://mail.python.org/mailman/listinfo/python-list

Re: removing file by inode

2006-03-23 Thread Arne Ludwig
> under SunOS there was a way to delete a file given it's i-node. Yes and no. You probably mean "clri" which cleared the inode, but did not "remove the file", i.e. all the entries in directories pointing to it. In older Unices there was also "ncheck" to find the filesystem names for inode numbers

Re: question: how to clare the absolute url in a html file

2006-03-23 Thread Arne Ludwig
Perhaps this is what he means: re.sub("http://[^/]*/","/","http://palle.fi/wing/walla.htm";) '/wing/walla.htm' -- http://mail.python.org/mailman/listinfo/python-list

Re: removing file by inode

2006-03-23 Thread Arne Ludwig
Good answer. :) I seriously doubt it is possible except for the trivial solution: def remove_a_file(inode): os.system ("find / -inum %d | xargs rm -f" % (inode)) PS. Don't blame me if this function destroys your hard disk. I wrote it off the top of my head. -- http://mail.python.org/mailm

Re: path to modules per import statement

2006-03-23 Thread Arne Ludwig
Maybe he means: sys.path.append('/my/path') -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows getting local ip address

2006-03-23 Thread Arne Ludwig
That man is a genius: >>> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) >>> s.connect(("gmail.com",80)) >>> print s.getsockname() ('192.168.0.174', 2768) >>> s.close() Should work on Windows as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Server.sendmail with no "to_addrs" parameter.

2006-03-23 Thread Arne Ludwig
Sorry to have caused all that confusion. The quote from RFC822 I gave is really confusing and is indeed not relevant to the original question. As Tim pointed out, the "to_addrs" parameter in smtplib.py::sendmail is translated to the SMTP RCPT TO and thus must contain all the intended recipients whe

Re: Windows getting local ip address

2006-03-22 Thread Arne Ludwig
The second solution can give really weird results though, e.g. on my Linux system I get: >>> gethostbyaddr(gethostname()) ('linux.site', ['linux'], ['127.0.0.2']) A more flexible but potentially unportable way would be: >>> import socket >>> import fcntl >>> import struct >>> >>> def get_ip_addr

Re: Server.sendmail with no "to_addrs" parameter.

2006-03-22 Thread Arne Ludwig
> Can anyone suggest how I can get round this? I have attempted numerous > things, like making my recipient list = [''], but Exchange then tried > to send the mail to "[EMAIL PROTECTED]" . rfc822: Note that the "Bcc" field may be empty, while the "To" field rfc822: is required to have a

Re: Attached images by plain email.

2006-02-22 Thread Ludwig
Seems like you are not providing a full path to the file 'check.jpg'. How is your program supposed to know where in the filesystem it is located? Either that, or you have to put the file in the same directory that on which the program is running. Also, you should use two backslashes in the name: p