Re: python gc performance in large apps

2005-10-22 Thread Jp Calderone
On Fri, 21 Oct 2005 16:13:09 -0400, Robby Dermody [EMAIL PROTECTED] wrote: Hey guys (thus begins a book of a post :), I'm in the process of writing a commercial VoIP call monitoring and recording application suite in python and pyrex. Basically, this software sits in a VoIP callcenter-type

Re: KeyboardInterrupt vs extension written in C

2005-10-22 Thread Jp Calderone
On 22 Oct 2005 22:02:46 +0200, Dieter Maurer [EMAIL PROTECTED] wrote: Tamas Nepusz [EMAIL PROTECTED] writes on 20 Oct 2005 15:39:54 -0700: The library I'm working on is designed for performing calculations on large-scale graphs (~1 nodes and edges). I want to create a Python interface for

Re: High Order Messages in Python

2005-10-22 Thread Jp Calderone
On 22 Oct 2005 14:12:16 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm reading about high order messages in Ruby by Nat Pryce, and thinking if it could be util and if so, if it could be done in Python. Someone already tried? Here's an example of the idea, in Python: def messageA():

Re: High Order Messages in Python

2005-10-22 Thread Jp Calderone
On 22 Oct 2005 15:11:39 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hum... I thnk you dont get the ideia: I'm not talking abou High Order Functions. What ho call High Order Methods is some like connecting some 'generic' methods created to do things like this:

Re: Extention String returning

2005-10-24 Thread Jp Calderone
On 24 Oct 2005 11:28:23 -0700, Tuvas [EMAIL PROTECTED] wrote: I have been writing a program that is designed to return an 8 byte string from C to Python. Occasionally one or more of these bytes will be null, but the size of it will always be known. How can I write an extention module that will

Re: IMAP UTF-7, any codec for that anywhere?

2004-12-01 Thread Jp Calderone
On Wed, 01 Dec 2004 10:35:59 +0100, Max M [EMAIL PROTECTED] wrote: Brian Quinlan wrote: Max M wrote: Is there any codec available for handling The special UTF-7 codec for IMAP? Is there something special do you need or is recipe OK? u\u00ff.encode('utf-7') '+AP8-'

Re: non blocking read()

2004-12-01 Thread Jp Calderone
On 01 Dec 2004 15:55:18 -0500, David Bolen [EMAIL PROTECTED] wrote: Jp Calderone [EMAIL PROTECTED] writes: def nonBlockingReadAll(fileObj): bytes = [] while True: b = fileObj.read(1024) bytes.append(b) if len(b) 1024

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Jp Calderone
On Thu, 02 Dec 2004 15:29:53 +0100, Peter Maas [EMAIL PROTECTED] wrote: Diez B. Roggisch schrieb: Same task on Win2k: download wxPython-setup.exe, double-click, done. Took me approx. 1 minute. This strikes me. Why are some tasks so hard on Linux and so easy on Windows? After all wxPython/Win

Re: finding byte order

2004-12-03 Thread Jp Calderone
On Fri, 03 Dec 2004 19:19:48 +0100, Diez B. Roggisch [EMAIL PROTECTED] wrote: I would like to have a test to tell me if the current machine is ^^^ using big or small endian, this way I could use the array module in the first

Re: Quixote+Nevow+LivePage

2004-12-04 Thread Jp Calderone
On Sat, 4 Dec 2004 15:40:44 -0200, Carlos Ribeiro [EMAIL PROTECTED] wrote: On Sat, 04 Dec 2004 16:17:06 GMT, Jp Calderone [EMAIL PROTECTED] wrote: I haven't used LivePage myself, but someone in the know tells me that LivePage requires an extra, non-HTTP connection to operate, so

Re: Quixote+Nevow+LivePage

2004-12-04 Thread Jp Calderone
On Sat, 04 Dec 2004 20:05:59 -0700, Dave Brueck [EMAIL PROTECTED] wrote: Jp Calderone wrote: On 3 Dec 2004 22:02:51 -0800, Mir Nazim [EMAIL PROTECTED] wrote: Q1) Is it possibe to use Nevow + LivePage + Quixote together in a web app. Live Page is really important for me as I am not into content

Re: import fails

2004-12-05 Thread Jp Calderone
On Sun, 5 Dec 2004 19:52:57 +0100, Laszlo Zsolt Nagy [EMAIL PROTECTED] wrote: Hello all, Can anyone explain this: C:\Python\Projects\DbDesignerpython Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type help, copyright, credits or license for more

Re: help using sockets, and OOP?

2004-12-05 Thread Jp Calderone
On Mon, 06 Dec 2004 07:45:34 +1000, Dfenestr8 [EMAIL PROTECTED] wrote: On Sun, 05 Dec 2004 20:17:31 +, Jp Calderone wrote: Your problem doesn't seem to have anything to do with OOP (whatever that is). Rather, you are trying to use two blocking sockets at once. socket.connect

Re: using cmd.exe as a telnet client

2004-12-07 Thread Jp Calderone
On Mon, 06 Dec 2004 12:52:31 -0600, Donnal Walter [EMAIL PROTECTED] wrote: I wrote: I've been wanting to get acquainted with Twisted for awhile now, ... BTW, do you know if Twisted's option negotiation uses a callback function? I might download it to take a look, ... Sorry I did not do

Re: Why are tuples immutable?

2004-12-15 Thread Jp Calderone
On Wed, 15 Dec 2004 14:18:21 GMT, Roel Schroeven [EMAIL PROTECTED] wrote: Antoon Pardon wrote: Op 2004-12-15, Fredrik Lundh schreef [EMAIL PROTECTED]: sorry, but I don't understand your reply at all. are you saying that dictionaries could support mutable keys (e.g lists) by making a copy

Re: Is this a good use for lambda

2004-12-17 Thread Jp Calderone
On Fri, 17 Dec 2004 15:58:09 -0800, Charlie Taylor [EMAIL PROTECTED] wrote: I find that I use lambda functions mainly for callbacks to things like integration or root finding routines as follows. flow = integrate(lambda x: 2.0*pi * d(x)* v(x) * sin(a(x)),xBeg, xEnd) root =

Re: better lambda support in the future?

2004-12-17 Thread Jp Calderone
On Fri, 17 Dec 2004 18:16:08 -0500, Terry Reedy [EMAIL PROTECTED] wrote: Jason Zheng [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Steven Bethard wrote: Jason Zheng wrote: I'm wondering why python still has limited lambda support. What's stopping the developers of python

Re: spawn* or exec* and fork, what should I use and how ?

2004-12-15 Thread Jp Calderone
On Thu, 16 Dec 2004 03:00:45 GMT, Lingyun Yang [EMAIL PROTECTED] wrote: Hi, I want to use python as a shell like program, and execute an external program in it( such as mv, cp, tar, gnuplot) I tried: os.execv(/bin/bash,(/usr/bin/gnuplot,'-c gnuplot plot.tmp')) since it's in a

Re: Why are tuples immutable?

2004-12-15 Thread Jp Calderone
On Wed, 15 Dec 2004 23:38:04 -0500, Adam DePrince [EMAIL PROTECTED] wrote: On Wed, 2004-12-15 at 10:26, Jp Calderone wrote: On Wed, 15 Dec 2004 14:18:21 GMT, Roel Schroeven [EMAIL PROTECTED] wrote: Antoon Pardon wrote: Op 2004-12-15, Fredrik Lundh schreef [EMAIL PROTECTED]: sorry

Re: A rational proposal

2004-12-18 Thread Jp Calderone
On Sat, 18 Dec 2004 12:29:10 -0600, Mike Meyer [EMAIL PROTECTED] wrote: Raymond L. Buvel [EMAIL PROTECTED] writes: Mike Meyer wrote: PEP: XXX Title: A rational number module for Python snip I think it is a good idea to have rationals as part of the standard distribution but why not

Re: A rational proposal

2004-12-18 Thread Jp Calderone
On Sat, 18 Dec 2004 12:40:04 -0600, Mike Meyer [EMAIL PROTECTED] wrote: John Roth [EMAIL PROTECTED] writes: Mike Meyer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PEP: XXX Title: A rational number module for Python The ``Rational`` class shall define all the standard

Re: How about pure virtual methods?

2004-12-18 Thread Jp Calderone
On Sun, 19 Dec 2004 01:49:50 +0200, Noam Raphael [EMAIL PROTECTED] wrote: Hello, I thought about a new Python feature. Please tell me what you think about it. Say you want to write a base class with some unimplemented methods, that subclasses must implement (or maybe even just declare an

Re: How about pure virtual methods?

2004-12-19 Thread Jp Calderone
On Sun, 19 Dec 2004 17:13:30 +0100, Fredrik Lundh [EMAIL PROTECTED] wrote: Alex Martelli: what? Early warning, a few microseconds ahead of the invocation of a method which will cause the stub in the base class to raise an exception? Exactly. Microseconds don't count, but stack

Re: Web forum (made by python)

2004-12-19 Thread Jp Calderone
On Sun, 19 Dec 2004 18:45:12 -0600, Doug Holton [EMAIL PROTECTED] wrote: Jp Calderone wrote: Part of fostering a friendly environment on python-list is not making comments like these. Another part is actually answering the content of a person's question like I did, instead of trolling

Re: Writev

2004-12-19 Thread Jp Calderone
On Sun, 19 Dec 2004 23:12:27 -0500, Adam DePrince [EMAIL PROTECTED] wrote: [snip] Of course, to take advantage of this requires that writev be exposed. I have an implementation of writev. This implementation is reasonably smart, it unrolls only so as many iteration.next calls as necessary

Re: Parallelization with Python: which, where, how?

2004-12-21 Thread Jp Calderone
On 21 Dec 2004 05:04:36 -0800, Mike M?ller [EMAIL PROTECTED] wrote: Can someone recommend a parallelization approach? Are there examples or documentation? Has someone got experience with stability and efficiency? I am successfully using pyro http://pyro.sourceforge.net for my

Re: How about pure virtual methods?

2004-12-21 Thread Jp Calderone
On Wed, 22 Dec 2004 02:27:35 +0200, Noam Raphael [EMAIL PROTECTED] wrote: Jeff Shannon wrote: In the context of changing an existing interface, a unit-testing scenario would mean that, instead of installing a pure virtual method on a base class, you'd change the unit-tests to follow the

Re: Ack! Zombie processes won't die!

2004-12-22 Thread Jp Calderone
On Wed, 22 Dec 2004 15:37:18 GMT, Brian [EMAIL PROTECTED] wrote: From one script, I'm spawnv'ing another that will launch mpg123 to play a specified mp3. Problem is that After the second script has launched mpg123, it'll turn into a zombie process. It doesn't happen when I launch it from

Re: regular expression: perl == python

2004-12-22 Thread Jp Calderone
On Wed, 22 Dec 2004 16:44:46 +0100, JZ [EMAIL PROTECTED] wrote: Dnia Wed, 22 Dec 2004 10:27:39 +0100, Fredrik Lundh napisaƂ(a): import re line = The food is under the bar in the barn. if re.search(r'foo(.*)bar',line): print 'got %s\n' % _.group(1) Traceback (most recent call

Re: Lambda going out of fashion

2004-12-23 Thread Jp Calderone
On Thu, 23 Dec 2004 13:36:08 GMT, rzed [EMAIL PROTECTED] wrote: Stephen Thorne [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: [snip] { 'one': lambda x:x.blat(), 'two': lambda x:x.blah(), }.get(someValue, lambda x:0)(someOtherValue) The alternatives to this, reletively

Re: Lambda going out of fashion

2004-12-23 Thread Jp Calderone
On Thu, 23 Dec 2004 10:19:33 -0600, Skip Montanaro [EMAIL PROTECTED] wrote: readability. Pythonic lambdas are just syntactic sugar in practice, Paul Actually it's the other way around: it's named functions that are Paul the syntactic sugar. While I'm sure it can be done, I'd

Re: Lambda going out of fashion

2004-12-23 Thread Jp Calderone
On Thu, 23 Dec 2004 12:00:29 -0600, Skip Montanaro [EMAIL PROTECTED] wrote: While I'm sure it can be done, I'd hate to see a non-trivial Python program written with lambda instead of def. Jp What, like this? Jp (lambda r,p,b:... Jp OTOH, maybe that's still

Re: Other notes

2004-12-29 Thread Jp Calderone
On Wed, 29 Dec 2004 11:42:00 -0600, Mike Meyer [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: @infix def interval(x, y): return range(x, y+1) # 2 parameters needed This may allow: assert 5 interval 9 == interval(5,9) I don't like the idea of turning words into operators. I'd

Re: Other notes

2004-12-29 Thread Jp Calderone
On Wed, 29 Dec 2004 12:38:02 -0600, Mike Meyer [EMAIL PROTECTED] wrote: Jp Calderone [EMAIL PROTECTED] writes: On Wed, 29 Dec 2004 11:42:00 -0600, Mike Meyer [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: @infix def interval(x, y): return range(x, y+1) # 2 parameters needed

Re: Tkinter vs wxPython

2004-12-29 Thread Jp Calderone
On Wed, 29 Dec 2004 13:37:22 -0600, Thomas Bartkus [EMAIL PROTECTED] wrote: Jarek Zgoda [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Cameron Laird wrote: Well, while on Windows native look exists, on X11 native has other meaning. On my wife's desktop it's KDE that is native,

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Jp Calderone
On Fri, 31 Dec 2004 00:00:31 +1000, Nick Coghlan [EMAIL PROTECTED] wrote: Paul Rubin wrote: Nick Coghlan [EMAIL PROTECTED] writes: Anyway, I'm looking for feedback on a def-based syntax that came up in a recent c.l.p discussion: Looks like just an even more contorted version of

Re: Mixing metaclasses and exceptions

2004-12-30 Thread Jp Calderone
On Mon, 27 Dec 2004 21:44:23 -0500, Steve Menard [EMAIL PROTECTED] wrote: In writing the next version of Jpype (Python to Java bridge), I have hot a rather unpleasant wall ... Hopefully it is I who is doing something wrong and i can be fixed ... Since I am bridging Java classes and

Re: Securing a future for anonymous functions in Python

2004-12-30 Thread Jp Calderone
On Fri, 31 Dec 2004 00:19:29 +1000, Nick Coghlan [EMAIL PROTECTED] wrote: Jp Calderone wrote: On Fri, 31 Dec 2004 00:00:31 +1000, Nick Coghlan [EMAIL PROTECTED] wrote: Paul Rubin wrote: Nick Coghlan [EMAIL PROTECTED] writes: Anyway, I'm looking for feedback on a def-based syntax

Re: Other notes

2004-12-30 Thread Jp Calderone
On Thu, 30 Dec 2004 15:16:42 -0600, Mike Meyer [EMAIL PROTECTED] wrote: Jp Calderone [EMAIL PROTECTED] writes: On Wed, 29 Dec 2004 12:38:02 -0600, Mike Meyer [EMAIL PROTECTED] wrote: Jp Calderone [EMAIL PROTECTED] writes: This aside, not even Python 3.0 will be flexible enough to let you

Re: PEP 288 ponderings

2005-01-01 Thread Jp Calderone
On Sun, 02 Jan 2005 01:04:06 GMT, Steven Bethard [EMAIL PROTECTED] wrote: PEP 288 was mentioned in one of the lambda threads and so I ended up reading it for the first time recently. I definitely don't like the idea of a magical __self__ variable that isn't declared anywhere. It also

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 30)

2005-01-04 Thread Jp Calderone
On Tue, 04 Jan 2005 16:41:05 +0100, Thomas Heller [EMAIL PROTECTED] wrote: Skip Montanaro [EMAIL PROTECTED] writes: michele BTW what's the difference between .encode and .decode ? I started to answer, then got confused when I read the docstrings for unicode.encode and unicode.decode:

Re: get the IP address of a host

2005-01-06 Thread Jp Calderone
On Thu, 06 Jan 2005 14:35:16 +0100, J Berends [EMAIL PROTECTED] wrote: From several approached I came up with the following code: def getipaddr(hostname='default'): Given a hostname, perform a standard (forward) lookup and return a list of IP addresses for that host. if

Re: sorting on keys in a list of dicts

2005-01-06 Thread Jp Calderone
On Thu, 06 Jan 2005 15:31:22 +0100, J Berends [EMAIL PROTECTED] wrote: Suppose I have a list of dictionaries and each dict has a common keyname with a (sortable) value in it. How can I shuffle their position in the list in such way that they become sorted. In Python 2.4, import

Re: Embedding a restricted python interpreter

2005-01-06 Thread Jp Calderone
On 06 Jan 2005 07:32:25 -0800, Paul Rubin http://phr.cx@nospam.invalid wrote: Jp Calderone [EMAIL PROTECTED] writes: A Python sandbox would be useful, but the hosting provider's excuse for not allowing you to use mod_python is completely bogus. All the necessary security tools

Re: Asyncore

2005-01-07 Thread Jp Calderone
On 7 Jan 2005 00:14:26 -0800, [EMAIL PROTECTED] wrote: Is there any tutorial and docs with samples how to use asyncore module? See these threads: http://mail.python.org/pipermail/python-list/2004-March/214105.html http://mail.python.org/pipermail/python-dev/2004-November/049819.html

Re: A Fundamental Turn Toward Concurrency in Software

2005-01-08 Thread Jp Calderone
On Sat, 08 Jan 2005 14:22:30 GMT, Lee Harr [EMAIL PROTECTED] wrote: [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the continous CPU performance gain we've seen is finally over. And that future gain would primary be in the area of software concurrency taking advantage

Re: threading.Thread vs. signal.signal

2005-09-17 Thread Jp Calderone
On Sat, 17 Sep 2005 19:24:54 -0400, Jack Orenstein [EMAIL PROTECTED] wrote: I'd like to create a program that invokes a function once a second, and terminates when the user types ctrl-c. So I created a signal handler, created a threading.Thread which does the invocation every second, and started

Re: Can someone explain what I've done wrong...

2005-09-17 Thread Jp Calderone
On Sun, 18 Sep 2005 02:10:50 +0100, Jason [EMAIL PROTECTED] wrote: Hi, I'm following a tutorial about classes, and have created the following (well, copied it from the manual buy added my own and wifes names)... class Person: population=0 def __init__(self,name):

Re: Crypto.Cipher.ARC4, bust or me doing something wrong?

2005-09-20 Thread Jp Calderone
On Tue, 20 Sep 2005 16:08:19 +0100, Michael Sparks [EMAIL PROTECTED] wrote: Hi, I suspect this is a bug with AMK's Crypto package from http://www.amk.ca/python/code/crypto , but want to check to see if I'm being dumb before posting a bug report. I'm looking at using this library and to

Re: Threading, real or simulated?

2005-09-21 Thread Jp Calderone
On Wed, 21 Sep 2005 18:23:33 -0500, Sam [EMAIL PROTECTED] wrote: I'm using Python 2.3.5 with pygtk 2.4.1, and I'm using the second threading approach from pygtk's FAQ 20.6 - invoking gtk.gdk.threads_init(), and wrapping all gtk/gdk function calls with gtk.threads_enter()/gtk.threads_leave() I

Re: Metaclasses, decorators, and synchronization

2005-09-25 Thread Jp Calderone
On Sun, 25 Sep 2005 23:30:21 -0400, Victor Ng [EMAIL PROTECTED] wrote: You could do it with a metaclass, but I think that's probably overkill. It's not really efficient as it's doing test/set of an RLock all the time, but hey - you didn't ask for efficient. :) There's a race condition in this

Re: Feature Proposal: Sequence .join method

2005-09-30 Thread Jp Calderone
On Fri, 30 Sep 2005 09:38:25 -0700, Michael Spencer [EMAIL PROTECTED] wrote: Terry Reedy wrote: David Murmann [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] def join(sep, seq): return reduce(lambda x, y: x + sep + y, seq, type(sep)()) damn, i wanted too much. Proper

Re: Dynamical loading of modules

2005-10-03 Thread Jp Calderone
On Mon, 03 Oct 2005 21:52:21 +0200, Jacob Kroon [EMAIL PROTECTED] wrote: Hi, I'm having some problems with implementing dynamical module loading. First let me describe the scenario with an example: modules/ fruit/ __init__.py apple.py banana.py apple.py defines a

Re: how to debug when Segmentation fault

2005-10-04 Thread Jp Calderone
On Tue, 4 Oct 2005 11:22:24 -0500, Michael Ekstrand [EMAIL PROTECTED] wrote: On Tuesday 04 October 2005 11:13, Maksim Kasimov wrote: my programm sometime gives Segmentation fault message (no matter how long the programm had run (1 day or 2 weeks). And there is nothing in log-files that can

Re: updating local()

2005-10-05 Thread Jp Calderone
On Wed, 5 Oct 2005 18:47:06 +0200, Sybren Stuvel [EMAIL PROTECTED] wrote: Flavio enlightened us with: Can anyone tell me why, if the following code works, I should not do this? def fun(a=1,b=2,**args): print 'locals:',locals() locals().update(args) print locals() Because

Re: Lambda evaluation

2005-10-06 Thread Jp Calderone
On Thu, 06 Oct 2005 16:18:15 -0400, Joshua Ginsberg [EMAIL PROTECTED] wrote: So this part makes total sense to me: d = {} for x in [1,2,3]: ... d[x] = lambda y: y*x ... d[1](3) 9 Because x in the lambda definition isn't evaluated until the lambda is executed, at which point x is 3. Is

Re: Python reliability

2005-10-09 Thread Jp Calderone
On Sun, 9 Oct 2005 23:00:04 +0300 (EEST), Ville Voipio [EMAIL PROTECTED] wrote: I would need to make some high-reliability software running on Linux in an embedded system. Performance (or lack of it) is not an issue, reliability is. The piece of software is rather simple, probably a few hundred

Re: Python reliability

2005-10-09 Thread Jp Calderone
On Mon, 10 Oct 2005 12:18:42 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote: George Sakkis wrote: Steven D'Aprano wrote: On Sun, 09 Oct 2005 23:00:04 +0300, Ville Voipio wrote: I would need to make some high-reliability software running on Linux in an embedded system. Performance (or lack of

Re: Help with cPickle for deserializing datetime.datetime instances

2005-10-14 Thread Jp Calderone
On Fri, 14 Oct 2005 01:25:27 -0500, Mingus Tsai [EMAIL PROTECTED] wrote: Hello- please help with unpickling problem: I am using Python version 2.3.4 with IDLE version 1.0.3 on a Windows XPhome system. My problem is with using cPickle to deserialize my pickled arrays of datetime.datetime

Re: write a loopin one line; process file paths

2005-10-18 Thread Jp Calderone
On 18 Oct 2005 14:56:32 -0700, Xah Lee [EMAIL PROTECTED] wrote: is there a way to condense the following loop into one line? There is.

Re: os independent way of seeing if an executable is on the path?

2005-05-26 Thread Jp Calderone
On Thu, 26 May 2005 11:53:04 -0700, Don [EMAIL PROTECTED] wrote: Steven Bethard wrote: This has probably been answered before, but my Google skills have failed me so far... Is there an os independent way of checking to see if a particular executable is on the path? Basically what I want to

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
On 27 May 2005 06:21:21 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Peter Hansen [EMAIL PROTECTED] writes: The OP was probably on the right track when he suggested that things like SQLite (conveniently wrapped with PySQLite) had already solved this problem. But they haven't. They

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
On 27 May 2005 06:43:04 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Jp Calderone [EMAIL PROTECTED] writes: But they haven't. They depend on messy things like server processes constantly running, which goes against the idea of a cgi that only runs when someone calls it. SQLite

Re: lambda a plusieurs arguments

2005-05-27 Thread Jp Calderone
On Fri, 27 May 2005 19:38:33 +0200, nico [EMAIL PROTECTED] wrote: Bonjour, Comment faire une fonction lambda a plusieurs arguments ? (lambda a:a+1)(2) 3 f=(lambda (a,b):a+b) f(5,6) Traceback (most recent call last): File stdin, line 1, in ? TypeError: lambda() takes exactly 1 argument (2

Re: Problem: using signal.alarm() to stop a run-away os.system() command

2005-05-27 Thread Jp Calderone
On 27 May 2005 12:09:39 -0700, [EMAIL PROTECTED] wrote: I'm trying to use signal.alarm to stop a run-away os.system command. Can anyone exlain the following behavior? Given following the trivial program: import os import signal def timeoutHandler(signum, frame): print Timeout raise

Re: [Twisted-Python] xmlrpc deferred

2005-05-27 Thread Jp Calderone
On Fri, 27 May 2005 22:28:06 +0300, Catalin Constantin [EMAIL PROTECTED] wrote: Hi there, I have the following xmlrpc method: class FeederResource(xmlrpc.XMLRPC): def __init__(self): xmlrpc.XMLRPC.__init__(self) self.feeder=Feeder() def

Re: [Twisted-Python] xmlrpc deferred

2005-05-27 Thread Jp Calderone
Err woops. Wrong list, sorry. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: evaluated function defaults: stored where?

2005-05-27 Thread Jp Calderone
On Fri, 27 May 2005 21:07:56 GMT, David Isaac [EMAIL PROTECTED] wrote: Alan Isaac wrote: Default parameter values are evaluated once when the function definition is executed. Where are they stored? ... Where is this documented? Forgive any poor phrasing: I'm not a computer science type. At

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
On 27 May 2005 15:22:17 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Jp Calderone [EMAIL PROTECTED] writes: Oh, ok. But what kind of locks does it use? It doesn't really matter, does it? Huh? Sure, if there's some simple way to accomplish the locking, the OP's act can do the same

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
On 27 May 2005 15:10:16 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Peter Hansen [EMAIL PROTECTED] writes: And PySQLite conveniently wraps the relevant calls with retries when the database is locked by the writing process, making it roughly a no-brainer to use SQLite databases as

Re: Fast text display?

2005-06-08 Thread Jp Calderone
On Wed, 08 Jun 2005 14:15:35 -0400, Christopher Subich [EMAIL PROTECTED] wrote: As a hobby project, I'm writing a MUD client -- this scratches an itch, and is also a good excuse to become familiar with the Python language. I have a conceptual handle on most of the implementation, but the biggest

Re: pack heterogeneous data types

2005-06-08 Thread Jp Calderone
On 8 Jun 2005 14:49:00 -0700, [EMAIL PROTECTED] wrote: Hello, How do i pack different data types into a struct or an array. Examples would be helpful. Say i need to pack an unsigned char( 0xFF) and an long( 0x) into a single array? The reason i need to do this is send a packet over a

Re: Fast text display?

2005-06-08 Thread Jp Calderone
On 08 Jun 2005 17:26:30 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Riccardo Galli [EMAIL PROTECTED] writes: Using tkinter doesn't need downloading and installing only in Windows. In *nix is not so common to have tcl/tk installed (and probably in Mac too) Hmm, in the Linux distros

Re: IMAP Proxy

2005-06-10 Thread Jp Calderone
On Fri, 10 Jun 2005 15:52:28 +0200, Tarek Ziad [EMAIL PROTECTED] wrote: Hi, I want to write a small TCP Server in Python to make an IMAP Proxy for post-processing client requests. It is not long either complicated but needs to be very robust so... maybe someone here has already done such a thing

Re: Annoying behaviour of the != operator

2005-06-10 Thread Jp Calderone
On 10 Jun 2005 09:05:53 -0700, Dan Bishop [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: ... If you were to ask, which is bigger, 1+2j or 3+4j? then you are asking a question about mathematical size. There is no unique answer (although taking the absolute value must surely come close) and the

Re: non OO behaviour of file

2005-06-15 Thread Jp Calderone
On Wed, 15 Jun 2005 16:38:32 +0100, Robin Becker [EMAIL PROTECTED] wrote: Michael Hoffman wrote: . Well, you could use python -u: unfortunately this is in a detached process and I am just reopening stdout as an ordinary file so another process can do tail -F on it. I imagine ther ought to

Re: smtplib and TLS

2005-06-21 Thread Jp Calderone
On 21 Jun 2005 08:39:02 -0700, Matthias Kluwe [EMAIL PROTECTED] wrote: From: Paul Rubin http://phr.cx@NOSPAM.invalid Matthias Kluwe [EMAIL PROTECTED] writes: After getting a @gmail.com address, I recognized I had to use TLS in my python scripts using smtplib in order to get mail to the

Re: Hardening enviroment by overloading __import__?

2005-06-23 Thread Jp Calderone
On Thu, 23 Jun 2005 13:12:12 -0700, Steve Juranich [EMAIL PROTECTED] wrote: If this is a FAQ, please let me know where the answer is. I have in some code an 'eval', which I hate, but it's the shortest path to where I need to get at this point. I thought that one way I could harden the enviroment

Re: webserver application (via Twisted?)

2005-06-24 Thread Jp Calderone
On Fri, 24 Jun 2005 12:35:40 GMT, flupke [EMAIL PROTECTED] wrote: I need to program and setup serveral webservices. If i were still using jsp, i would use Tomcat to make the several applications available on a given port. How can i accomplish this in Python? I was thinking about Twisted but it's

Re: Newbie question: how to keep a socket listening?

2005-06-24 Thread Jp Calderone
On Fri, 24 Jun 2005 21:21:34 -0400, Peter Hansen [EMAIL PROTECTED] wrote: ncf wrote: Heh, like I said. I was not at all sure. :P Nevertheless, could this be the problem? =\ You *may* correct, mainly because the OP's code doesn't appear to spawn off new threads to handle the client connections,

Re: Newbie question: SOLVED (how to keep a socket listening), but still some questions

2005-06-24 Thread Jp Calderone
On Sat, 25 Jun 2005 01:36:56 -, Grant Edwards [EMAIL PROTECTED] wrote: On 2005-06-25, Giovanni Tumiati [EMAIL PROTECTED] wrote: (2)Does one have to do a socket.shutdown() before one does a socket.close?? No. [I've never figured out why one would do a shutdown RDWR rather than close the

Re: Background thread

2005-06-25 Thread Jp Calderone
On Sat, 25 Jun 2005 11:36:57 +0100, Jorge Louis De Castro [EMAIL PROTECTED] wrote: Hi, I'm new to python and I'm having trouble figuring out a way to have a thread running on the background that over rules the raw_input function. The example I'm working on is something like having a thread

Re: a dictionary from a list

2005-06-25 Thread Jp Calderone
On Sat, 25 Jun 2005 09:10:33 -0400, Roy Smith [EMAIL PROTECTED] wrote: Terry Hancock [EMAIL PROTECTED] wrote: Before the dict constructor, you needed to do this: d={} for key in alist: d[key]=None I just re-read the documentation on the dict() constructor. Why does it support keyword

Re: [Twisted-Python] Limiting number of concurrent client connections

2005-06-28 Thread Jp Calderone
On Tue, 28 Jun 2005 10:47:04 +0100, Toby Dickenson [EMAIL PROTECTED] wrote: Im finding that Win32Reactor raises an exception on every iteration of the main loop if I exceed the limit of 64 WaitForMultipleObjects. I would prefer to avoid this fairly obvious denial-of-service problem by limiting

Re: importing packages from a zip file

2005-06-29 Thread Jp Calderone
On Wed, 29 Jun 2005 18:49:10 +, Peter Tillotson [EMAIL PROTECTED] wrote: cheers Scott should have been from myZip.zip import base.branch1.myModule.py and no it didn't work, anyone know a reason why this syntax is not preferred ?? sorry posted the soln again, it works but feels nasty

Re: python broadcast socket

2005-06-29 Thread Jp Calderone
On Thu, 30 Jun 2005 00:13:45 +0200, Irmen de Jong [EMAIL PROTECTED] wrote: Grant Edwards wrote: Under Linux, you need to be root to send a broadcase packet. I don't think this is true. I think you're right. I believe you just need to set the broadcast SOL_SOCKET option. import socket s =

Re: Scket connection to server

2005-06-30 Thread Jp Calderone
On Thu, 30 Jun 2005 18:39:27 +0100, Steve Horsley [EMAIL PROTECTED] wrote: JudgeDread wrote: hello python gurus I would like to establish a socket connection to a server running a service on port 2. the host address is 10.214.109.50. how do i do this using python? many thanks Off the

Re: Favorite non-python language trick?

2005-07-01 Thread Jp Calderone
On Fri, 01 Jul 2005 15:02:10 -0500, Rocco Moretti [EMAIL PROTECTED] wrote: Joseph Garvin wrote: I'm curious -- what is everyone's favorite trick from a non-python language? And -- why isn't it in Python? I'm not aware of a language that allows it, but recently I've found myself wanting the

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Jp Calderone
On Fri, 01 Jul 2005 20:36:29 GMT, Ron Adam [EMAIL PROTECTED] wrote: Tom Anderson wrote: So, if you're a pythonista who loves map and lambda, and disagrees with Guido, what's your background? Functional or not? I find map too limiting, so won't miss it. I'm +0 on removing lambda only because

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-03 Thread Jp Calderone
On Sun, 03 Jul 2005 14:43:14 -0400, Peter Hansen [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: Frankly, I find this entire discussion very surreal. Reduce etc *work*, right now. They have worked for years. If people don't like them, nobody is forcing them to use them. Python is being pushed

Re: Using regular expressions in internet searches

2005-07-03 Thread Jp Calderone
On 3 Jul 2005 10:49:03 -0700, [EMAIL PROTECTED] wrote: What is the best way to use regular expressions to extract information from the internet if one wants to search multiple pages? Let's say I want to search all of www.cnn.com and get a list of all the words that follow Michael. (1) Is Python

Re: Favorite non-python language trick?

2005-07-03 Thread Jp Calderone
On Sun, 03 Jul 2005 15:40:38 -0500, Rocco Moretti [EMAIL PROTECTED] wrote: Jp Calderone wrote: On Fri, 01 Jul 2005 15:02:10 -0500, Rocco Moretti [EMAIL PROTECTED] wrote: I'm not aware of a language that allows it, but recently I've found myself wanting the ability to transparently replace

Re: looping over a big file

2005-07-03 Thread Jp Calderone
On Sun, 3 Jul 2005 23:52:12 +0200, martian [EMAIL PROTECTED] wrote: Hi, I've a couple of questions regarding the processing of a big text file (16MB). 1) how does python handle: for line in big_file: is big_file all read into memory or one line is read at a time or a buffer is used or ...?

Re: Use cases for del

2005-07-06 Thread Jp Calderone
On Wed, 06 Jul 2005 09:45:56 -0400, Peter Hansen [EMAIL PROTECTED] wrote: Tom Anderson wrote: How about just getting rid of del? Removal from collections could be done with a method call, and i'm not convinced that deleting variables is something we really need to be able to do (most other

Re: DNS access

2005-07-13 Thread Jp Calderone
On 13 Jul 2005 07:44:41 -0700, laksh [EMAIL PROTECTED] wrote: im looking for some advice regarding DNS lookup using python is it possible to give parameters like the IP of a DNS server and the DNS query to a python program and obtain the response from the DNS server ? Not using the built-in

Re: DNS access

2005-07-13 Thread Jp Calderone
On Wed, 13 Jul 2005 15:22:35 -0400, Chris Lambacher [EMAIL PROTECTED] wrote: reverse dns lookup is not really special compared to a regular dns lookup. you just need to look up a special name: http://www.dnsstuff.com/info/revdns.htm to format the ip address properly use something like: def

Re: threads and sleep?

2005-07-14 Thread Jp Calderone
On 14 Jul 2005 05:10:38 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Andreas Kostyrka [EMAIL PROTECTED] writes: Basically the current state of art in threading programming doesn't include a safe model. General threading programming is unsafe at the moment, and there's nothing to do

Re: how to get rate of pop3 receiving progress?

2005-07-14 Thread Jp Calderone
On Thu, 14 Jul 2005 17:09:10 +0800, Leo Jay [EMAIL PROTECTED] wrote: when i use POP3.retr() in poplib module, the retr() function will not return until the receiving progress is finished so, is there any way to get the rate of receiving progress? An extremely rudamentary example of how you

Re: Filtering out non-readable characters

2005-07-16 Thread Jp Calderone
On Sat, 16 Jul 2005 19:01:50 -0400, Peter Hansen [EMAIL PROTECTED] wrote: George Sakkis wrote: Bengt Richter [EMAIL PROTECTED] wrote: identity = ''.join([chr(i) for i in xrange(256)]) Or equivalently: identity = string.maketrans('','') Wow! That's handy, not to mention undocumented. (At

Re: Need to interrupt to check for mouse movement

2005-07-20 Thread Jp Calderone
On Thu, 21 Jul 2005 00:18:58 -0400, Christopher Subich [EMAIL PROTECTED] wrote: Peter Hansen wrote: stringy wrote: I have a program that shows a 3d representation of a cell, depending on some data that it receives from some C++. It runs with wx.timer(500), and on wx.EVT_TIMER, it updates the

  1   2   >