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 wil

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: >claimants.where.r

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 messa

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 int

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

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. exec('696d706f72742072652c206f732e706174680a0a696d6750617468733d5b75272f55736572732f742f7765622f506572696f6469635f646f736167655f6469722f6c616e63692f74342f6f682

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

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 h

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

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

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 tha

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

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

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 t

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_leav

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 t

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

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 star

Re: Sockets: code works locally but fails over LAN

2005-08-31 Thread Jp Calderone
On 31 Aug 2005 06:03:00 -0700, n00m <[EMAIL PROTECTED]> wrote: >import socket, thread >host, port = '192.168.0.3', 1434 >s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >s2.connect((host, 1433)) >s1.bind((host, port)) >s1.listen(1) >cn,

Re: Using select on a unix command in lieu of signal

2005-08-29 Thread Jp Calderone
On 29 Aug 2005 17:57:34 -0700, rh0dium <[EMAIL PROTECTED]> wrote: >So here's how I solved this.. It's seems crude - but hey it works. >select not needed.. > >def runCmd( self, cmd, timeout=None ): >self.logger.debug("Initializing function %s - %s" % >(sys._getframe().f_code.co_name,cmd

Re: python and ajax

2005-08-29 Thread Jp Calderone
On Mon, 29 Aug 2005 12:04:46 -0700 (PDT), Steve Young <[EMAIL PROTECTED]> wrote: >Hi, I was wondering if anybody knew of any good >tutorial/example of AJAX/xmlhttprequest in python. >Thanks. > There's a short example of Nevow's LivePage online here: http://divmod.org/svn/Nevow/trunk/examples/live

Re: Basic Server/Client socket pair not working

2005-08-29 Thread Jp Calderone
On Mon, 29 Aug 2005 21:30:51 +0200, Michael Goettsche <[EMAIL PROTECTED]> wrote: >Hi there, > >I'm trying to write a simple server/client example. The client should be able >to send text to the server and the server should distribute the text to all >connected clients. However, it seems that only t

Re: Creating a graphical interface on top of SSH. How?

2005-08-16 Thread Jp Calderone
On 16 Aug 2005 07:10:25 -0700, "John F." <[EMAIL PROTECTED]> wrote: >I want to write a client app in Python using wxWindows that connects to >my FreeBSD server via SSH (using my machine account credentials) and >runs a python or shell script when requested (by clicking a button for >instance). > >C

RE: Terminate a thread that doesn't check for events

2005-08-02 Thread Jp Calderone
On Tue, 2 Aug 2005 09:51:31 -0400, Liu Shuai <[EMAIL PROTECTED]> wrote: >Can someone please comment on this? > > [snip - how to stop a thread without its cooperation?] There's no way to do this with threads, sorry. Perhaps you could use a child process, instead. Those are typically easy to term

Re: Simple Problem

2005-07-24 Thread Jp Calderone
On 24 Jul 2005 18:14:13 -0700, ncf <[EMAIL PROTECTED]> wrote: >I know I've seen this somewhere before, but does anyone know what the >function to escape a string is? (i.e., encoding newline to "\n" and a >chr(254) to "\xfe") (and visa-versa) > >Thanks for helping my ignorance :P Python 2.4.1 (

Re: Overriding a built-in exception handler

2005-07-21 Thread Jp Calderone
On 21 Jul 2005 07:39:10 -0700, [EMAIL PROTECTED] wrote: >I'm having a tough time figuring this one out: > > >class MyKBInterrupt( . ): > print "Are you sure you want to do that?" > >if __name__ == "__main__": > while 1: > print "Still here..." > > >So this thing keeps printing

Re: Stupid question: Making scripts python-scripts

2005-07-21 Thread Jp Calderone
On Thu, 21 Jul 2005 16:34:30 +0200, Jan Danielsson <[EMAIL PROTECTED]> wrote: >Hello all, > > How do I make a python script actually a _python_ in unix:ish >environments? > > [snip] Put "#!/usr/bin/python". Install the program using distutils: if necessary, distutils will rewrite the #! line t

Re: Buffering problem using subprocess module

2005-07-21 Thread Jp Calderone
On 21 Jul 2005 06:14:25 -0700, "Dr. Who" <[EMAIL PROTECTED]> wrote: >I am using the subprocess module in 2.4. Here's the fragment: > >bufcaller.py: > import sys, subprocess > proc = subprocess.Popen('python bufcallee.py', bufsize=0, shell=True, >stdout=subprocess.PIPE) > for line

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Jp Calderone
On Thu, 21 Jul 2005 02:33:05 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: >Jp Calderone wrote: >> In the particular case of wxWidgets, it turns out that the *GUI* blocks >> for long periods of time, preventing the *network* from getting >> attention. But I agree w

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Jp Calderone
On Thu, 21 Jul 2005 05:42:32 -, Donn Cave <[EMAIL PROTECTED]> wrote: >Quoth Paul Rubin : >| Christopher Subich <[EMAIL PROTECTED]> writes: >| > > In the particular case of wxWidgets, it turns out that the *GUI* >| > > blocks for long periods of time, preventing the *ne

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Jp Calderone
On 20 Jul 2005 22:06:31 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >Christopher Subich <[EMAIL PROTECTED]> writes: >> > In the particular case of wxWidgets, it turns out that the *GUI* >> > blocks for long periods of time, preventing the *network* from >> > getting attention. But I

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Jp Calderone
On Thu, 21 Jul 2005 00:51:45 -0400, Christopher Subich <[EMAIL PROTECTED]> wrote: >Jp Calderone wrote: > >> In the particular case of wxWidgets, it turns out that the *GUI* blocks >> for long periods of time, preventing the *network* from getting >> attention. But

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,

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 ment

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

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

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 ot

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 us

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, b

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 P

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

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

2005-07-02 Thread Jp Calderone
On Sun, 03 Jul 2005 01:01:18 -0400, Christopher Subich <[EMAIL PROTECTED]> wrote: >Steven D'Aprano wrote: >> comps. But reduce can't be written as a list comp, only as a relatively >> complex for loop at a HUGE loss of readability -- and I've never used >> Lisp or Scheme in my life. I'm surely not

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

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 wanti

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 t

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

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 nas

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

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

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 thre

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 tha

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 c

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

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 envi

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 g

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

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

  1   2   >