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-1

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 > > > > > > I think it is a good idea to have rationals as part of the standard > > distr

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 defi

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 de

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,

Re: Web forum (made by python)

2004-12-19 Thread Jp Calderone
On Sun, 19 Dec 2004 18:30:03 -0600, Doug Holton <[EMAIL PROTECTED]> wrote: >Gezer Punta wrote: > > > hi all > > I am looking for a forum which was produced by python > > If you want Zope-based, try Plone. But probably you don't. > I am not aware of any standard python CGI-based forum software,

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

Re: A completely silly question

2004-12-19 Thread Jp Calderone
On Sun, 19 Dec 2004 23:15:40 GMT, Keith Dart <[EMAIL PROTECTED]> wrote: >Mike Meyer wrote: > > The termios gives module gives you the tools to manipulate the tty > > directly, without invoking stty. The tty module gives you an easier > > interface to those routines. However, it's missing a setsane

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 ne

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 > paral

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 fol

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 > i

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 (m

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

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 b

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

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 ope

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: > >> > >> >

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 K

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 conto

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 pr

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 P

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: >

Re: String Splitter Brain Teaser

2005-03-27 Thread Jp Calderone
On Sun, 27 Mar 2005 14:39:06 -0800, James Stroud <[EMAIL PROTECTED]> wrote: >Hello, > > I have strings represented as a combination of an alphabet (AGCT) and a an > operator "/", that signifies degeneracy. I want to split these strings into > lists of lists, where the degeneracies are members of

Re: Dumb*ss newbie Q

2005-03-27 Thread Jp Calderone
On Sun, 27 Mar 2005 17:06:05 -0800, Captain Dondo <[EMAIL PROTECTED]> wrote: > [snip] > > def url (self): > self.url = ... > > def thumb (self): > self.thumb = ... > > [snip] > > The problem is that m.html in the test section fails with > > TypeError: cannot concatenat

Re: Overriding methods in classes you don't control

2005-03-27 Thread Jp Calderone
On Mon, 28 Mar 2005 03:57:16 GMT, Alex VanderWoude <[EMAIL PROTECTED]> wrote: >Is there a way to override a method on a class whose source you cannot > change in such a way that you can hook into that method's code? After doing > some research, it appears that one way to do such a thing is to crea

Re: SSL Server Socket Support in Python?

2005-04-22 Thread Jp Calderone
On Fri, 22 Apr 2005 14:59:59 +0200, André Søreng <[EMAIL PROTECTED]> wrote: I'm trying to create a SSL-enabled server in Python, and in the doc for the socket module: ssl(sock[, keyfile, certfile]) Initiate a SSL connection over the socket sock. keyfile is the name of a PEM formatted f

Re: Unicode problems, yet again

2005-04-23 Thread Jp Calderone
On Sun, 24 Apr 2005 03:15:02 +0200, Ivan Voras <[EMAIL PROTECTED]> wrote: I have a string fetched from database, in iso8859-2, with 8bit characters, and I'm trying to send it over the network, via a socket: You don't have a string fetched from a database, in iso-8859-2, alas. That is the root o

Re: What is situation with threads in Python

2005-04-25 Thread Jp Calderone
On Mon, 25 Apr 2005 14:10:28 -0400, Bill Mill <[EMAIL PROTECTED]> wrote: On 4/25/05, Leonard J. Reder <[EMAIL PROTECTED]> wrote: Hello Mark, I took your three day course here at JPL and recall that you said something was wrong with the implementation of threads within Python but I cannot recall wha

Re: What is situation with threads in Python

2005-04-25 Thread Jp Calderone
On Mon, 25 Apr 2005 10:46:57 -0700, "Leonard J. Reder" <[EMAIL PROTECTED]> wrote: Hello Mark, I took your three day course here at JPL and recall that you said something was wrong with the implementation of threads within Python but I cannot recall what. So what is wrong with threads in Python?

Re: compile shebang into pyc file

2005-04-26 Thread Jp Calderone
On 26 Apr 2005 08:19:43 -0700, Joerg Schuster <[EMAIL PROTECTED]> wrote: Hello, is there a way to compile a python file foo.py to foo.pyc (or foo.pyo) such that foo.pyc can be run with 'foo.pyc' (as opposed to 'python foo.pyc') on the command line? No. However, on Linux, read up on /proc/sys/fs/b

Re: Coding Standards (and Best Practices)

2005-04-26 Thread Jp Calderone
On Tue, 26 Apr 2005 14:04:45 -0400, Isaac Rodriguez <[EMAIL PROTECTED]> wrote: Hi, I am fairily new to Python, but I am really liking what I am seeing. My team is going to re-design some automation projects, and we were going to use Python as our programming language. One of the things we would lik

Re: compile shebang into pyc file

2005-04-27 Thread Jp Calderone
On Wed, 27 Apr 2005 10:37:11 -0400, Michael Soulier <[EMAIL PROTECTED]> wrote: On 26 Apr 2005 18:15:51 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Is there some reason why you want to run the .pyc file, rather than the .py file? If you start the script with a. It's more efficient, since the

Re: Shutting down twisted reacotr

2005-04-28 Thread Jp Calderone
On Thu, 28 Apr 2005 12:34:33 + (UTC), Operation Latte Thunder <[EMAIL PROTECTED]> wrote: Jason Mobarak <[EMAIL PROTECTED]> wrote: Why do you want to do this in a thread? What's wrong with reactor.callLater? import time from twisted.internet import reactor def shutdown(): time.sleep(3) pr

Re: Reusing object methods?

2005-04-29 Thread Jp Calderone
On Fri, 29 Apr 2005 19:45:54 +0200, Ivan Voras <[EMAIL PROTECTED]> wrote: Can this be done: (this example doesn't work) class A: def a_lengthy_method(self, params): # do some work depending only on data in self and params class B: def __init__(self): self.a_lengthy_met

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread Jp Calderone
On 01 May 2005 10:09:56 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: "fo" <[EMAIL PROTECTED]> writes: How would I get the worker thread to open a GUI window in the main GUI thread? After that GUI window is open, how can I send and recv messages from/to the GUI window? First of all

Re: BitKeeper for Python?

2005-05-01 Thread Jp Calderone
On Sun, 01 May 2005 20:16:40 GMT, John Smith <[EMAIL PROTECTED]> wrote: I am going to be working with some people on a project that is going to be done over the internet. I am looking for a good method of keeping everyone's code up to date and have everyone be able to access all the code including

Re: Whats the best Python Book for me

2005-05-01 Thread Jp Calderone
On Sun, 01 May 2005 20:18:39 GMT, John Smith <[EMAIL PROTECTED]> wrote: I already know C/C++ programming and now wish to learn Python to do scripting for some games that are coming out. What book would you recommend. I am thinking Teach Your Self Python in 24 Hours is probably the best place to sta

Re: Debugging threaded Python code

2005-05-01 Thread Jp Calderone
On Mon, 02 May 2005 12:52:30 +1000, Derek Thomson <[EMAIL PROTECTED]> wrote: >Hi, > >I frequently have to debug some fairly tricky Python multi-threaded >code, and I need some help using the debugger to help me diagnose the >problems when they occur. Yes, I know that the best option with threaded >

Re: BitKeeper for Python?

2005-05-02 Thread Jp Calderone
On 02 May 2005 09:30:05 GMT, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: >John Smith <[EMAIL PROTECTED]> wrote: >> I am going to be working with some people on a project that is going to be >> done over the internet. I am looking for a good method of keeping everyone's >> code up to date and have

Re: pop3proxy

2005-05-02 Thread Jp Calderone
On Mon, 02 May 2005 16:05:13 +0200, BrokenClock <[EMAIL PROTECTED]> wrote: >Hello every body, > >Here is a python newbie! I've choose it to make a pop3 proxy - I want to >filter content between a pop3 client and a pop3 server, and I have no >control on the server... >First, I wanted to do an non-fi

Re: Bandwith Shaping

2005-05-04 Thread Jp Calderone
On 4 May 2005 10:48:41 -0700, flamesrock <[EMAIL PROTECTED]> wrote: >Just curious - is there an easy way to shape bandwith in python. If I >wanted to have a max download speed for instance > Twisted includes an HTB implementation. http://twistedmatrix.com/documents/current/api/twisted.protoco

Re: Sockets

2005-05-05 Thread Jp Calderone
On Thu, 05 May 2005 17:11:08 +0800, Dan <[EMAIL PROTECTED]> wrote: > > >I have a problem and I don't quite know how to implement the solution. > >I'll have a server application that will listen on a tcp port and make >many similtaneous connections to remote clients. From time to time, >I'll need t

Re: Database backend?

2005-05-08 Thread Jp Calderone
On Sun, 08 May 2005 20:09:29 +0200, Mikkel Høgh <[EMAIL PROTECTED]> wrote: I am in the progress of laying the groundwork for a small application I intend to make, and I'd like some expert advice, since this is the first larger project I've gotten myself into. First problem is which backend to use f

Re: A question about inheritance

2005-05-08 Thread Jp Calderone
On 8 May 2005 12:07:58 -0700, [EMAIL PROTECTED] wrote: >Hello I have a question about inheritance in Python. I'd like to do >something like this: > > class cl1: > def __init__(self): > self.a = 1 > > class cl2(cl1): > def __init__(self): > self.b = 2 > >But in such a way that cl2 instances ha

Re: Clueless with cPickle

2005-05-08 Thread Jp Calderone
On Sun, 08 May 2005 21:27:35 GMT, les <[EMAIL PROTECTED]> wrote: >I am working on a homework assignment and trying to use cPickle to store >the answers from questor.py I believe I have the syntax correct but am not >sure if I am placing everything where it needs to be. Any help would be >greatly a

Re: __brace__ (PEP?)

2005-05-08 Thread Jp Calderone
On Sun, 8 May 2005 16:29:03 -0700, James Stroud <[EMAIL PROTECTED]> wrote: >Hello All, > >If "__call__" allows anobject() and "__getitem__" allows anobject[arange], why >not have "__brace__" (or some other, better name) for anobject{something}. >Such braces might be useful for cross-sectioning nest

Re: how to calc the difference between two datetimes?

2005-05-08 Thread Jp Calderone
On Sun, 8 May 2005 19:06:31 -0600, Stewart Midwinter <[EMAIL PROTECTED]> wrote: >After an hour of research, I'm more confused than ever. I don't know >if I should use the time module, or the eGenix datetime module. Here's >what I want to do: I want to calculate the time difference (in >seconds wou

Re: Put a file on an ftp server over ssl

2005-05-10 Thread Jp Calderone
On 10 May 2005 09:55:32 -0700, Daniel Santa Cruz <[EMAIL PROTECTED]> wrote: >Hello all! > >I have been troubled for the past couple of days trying to write a >simple script that sends a file to an ftp server. It used to be the >easiest thing in the world, but now the server has changed to a ftps >

Re: Put a file on an ftp server over ssl

2005-05-10 Thread Jp Calderone
On 10 May 2005 11:32:39 -0700, Daniel Santa Cruz <[EMAIL PROTECTED]> wrote: >I looked briefly at this option, but it seems to me that I would have >to learn a whole architecture just to put a file on an ftp server. >Seems like a bit much, don't you think? (In the absence of any quoted material,

Re: Solipsis: Python-powered Metaverse

2005-05-10 Thread Jp Calderone
On Tue, 10 May 2005 19:27:00 -0700, Paul McNett <[EMAIL PROTECTED]> wrote: >Joseph Garvin wrote: >> I was looking at this earlier today because I was curious how they were >> going to handle performance concerns (both due to Python and bandwidth). >> I'm having trouble understanding all of the deta

Re: Replacing open builtin

2005-05-11 Thread Jp Calderone
On 11 May 2005 05:20:28 -0700, [EMAIL PROTECTED] wrote: >If I replace the open builtin eg > >import main >__main__.__builtins__.open=None > >Is there any way, from here on, to access the original open function?? > >Extending this slightly, lets say I put a reference to the original >open function i

Re: Replacing open builtin

2005-05-11 Thread Jp Calderone
On 11 May 2005 05:56:04 -0700, [EMAIL PROTECTED] wrote: >Sorry, should maybe have used __import__ as an example. >Let's say I grab import, store the reference within the Isolate class >and then redirect the builtin import to a function in the Isolate class >which only allows certain modules to be i

RE: Interactive shell for demonstration purposes

2005-05-11 Thread Jp Calderone
On Wed, 11 May 2005 13:55:38 +0100, Tim Golden <[EMAIL PROTECTED]> wrote: >[Brian Quinlan] >| >| Can anyone recommend a Python interactive shell for use in >| presentations? >| >| Ideal characteristics (priority order): >| o configurable font size >| o full screen mode >| o readline support >| o sy

Re: Escape spaces in strings

2005-05-12 Thread Jp Calderone
On Fri, 13 May 2005 00:49:21 +0200, Florian Lindner <[EMAIL PROTECTED]> wrote: >Hello, >is there a function to escape spaces and other characters in string for >using them as a argument to unix command? In this case rsync >(http://samba.anu.edu.au/rsync/FAQ.html#10) > >Thx, > >Florian Yes, but y

Re: wxTimer problem

2005-05-13 Thread Jp Calderone
On Fri, 13 May 2005 14:57:26 +0800, Austin <[EMAIL PROTECTED]> wrote: >I wrote a GUI program on windows. (python & wxPython) >One function is to refresh the data from the COM Object continously. >In the beginning, I used the thread.start_new_thread(xxx,()) >But no matter how i try, it will cause th

Re: doc tags?

2005-05-13 Thread Jp Calderone
On Fri, 13 May 2005 06:44:46 -0700, Robert Kern <[EMAIL PROTECTED]> wrote: >Larry Bates wrote: >> In python they are called decorators, but I've never had a >> need to use them myself, but then I'm a little old fashioned. > >Decorators only work on function and method definitions. I don't think >th

Re: stop a thread safetely

2005-05-13 Thread Jp Calderone
On Fri, 13 May 2005 16:47:34 +0200, Zunbeltz Izaola <[EMAIL PROTECTED]> wrote: >On Fri, 13 May 2005 09:10:13 -0400, Peter Hansen wrote: > >> >> How did you intend to stop the thread in a manner which might be unsafe? >> (Hint, unless you're doing something unusual, you can't.) >> > >I have a thread

Re: Solipsis: Python-powered Metaverse

2005-05-13 Thread Jp Calderone
7On Sat, 14 May 2005 02:28:57 +0300, Christos TZOTZIOY Georgiou <[EMAIL PROTECTED]> wrote: >On Wed, 11 May 2005 22:48:31 -0400, rumours say that "Terry Reedy" ><[EMAIL PROTECTED]> might have written: > >>> and what if both computers >>> wanted to participate on the port 6000 fun? > >>Recently, I

Re: Twisted an several CPUs

2005-05-19 Thread Jp Calderone
On Thu, 19 May 2005 17:22:31 +0200, Thomas Guettler <[EMAIL PROTECTED]> wrote: >Hi, > >Out of sheer curiosity: > >Does Twisted scale if the server has several CPUs? > No more than any other single-process Python application (no less, either). Unless you run multiple processes... >As far as I

Re: Twisted an several CPUs

2005-05-19 Thread Jp Calderone
On 19 May 2005 17:01:11 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >Jp Calderone <[EMAIL PROTECTED]> writes: >> Distributing load across multiple machines scales better than >> distributing it over multiple CPUs in a single machine

Re: buffer_info error

2005-05-20 Thread Jp Calderone
On 20 May 2005 13:18:33 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >i am filling in a packet with source and destination address and using >the buffer_info call to pass on the address to an underlying low level >call. > >The src and dest are strings, but buffer_info expects an array. How

Re: first release of PyPy

2005-05-21 Thread Jp Calderone
On 21 May 2005 17:57:17 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >Christian Tismer <[EMAIL PROTECTED]> writes: >> Type inference works fine for our implementation of Python, >> but it is in fact very limited for full-blown Python programs. >> Yoou cannot do much more than to try t

Re: line-by-line output from a subprocess

2005-05-23 Thread Jp Calderone
On 23 May 2005 13:22:04 -0700, Simon Percivall <[EMAIL PROTECTED]> wrote: >Okay, so the reason what you're trying to do doesn't work is that the >readahead buffer used by the file iterator is 8192 bytes, which clearly >might be too much. It also might be because the output from the >application you

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 wh

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 ha

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 ide

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 "", line 1, in ? >TypeError: () takes exactly 1 ar

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" >

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() > >de

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

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&#

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 da

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 >big

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

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 Linu

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 suc

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 clos

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 th

<    1   2