Re: Python Subprocess module

2007-07-15 Thread Josiah Carlson
Dave Sampson wrote: > I am supposed to be able to entre 'y' and return for the program to > continue if I agree with what I see in the stdout. > > A problem exists though that I have tried > 'y' > 'y\n' > 'y\r' Depending on the platform, you may need to send '\r\n'. > ASPN Python cookbok provi

Re: Marshalling big objects

2007-07-15 Thread Josiah Carlson
Gabriel Genellina wrote: > En Sat, 14 Jul 2007 20:04:21 -0300, Orlando Döhring <[EMAIL PROTECTED]> > escribió: > >> I want to marshal objects: >> >> - http://docs.python.org/lib/module-marshal.html >> where I have problems with a bigger objects, e.g. > > Any specific reason you use this module?

Re: Implementaion of random.shuffle

2007-07-17 Thread Josiah Carlson
shabda raaj wrote: > The code for shuffle is > > if random is None: > random = self.random > for i in reversed(xrange(1, len(x))): > # pick an element in x[:i+1] with which to exchange x[i] > j = int(random() * (i+1)) > x[i], x[

Re: wxPython and threads

2007-07-19 Thread Josiah Carlson
Benjamin wrote: > I'm writing a search engine in Python with wxPython as the GUI. I have > the actual searching preformed on a different thread from Gui thread. > It sends it's results through a Queue to the results ListCtrl which > adds a new item. This works fine or small searches, but when the >

Re: wxPython and threads

2007-07-19 Thread Josiah Carlson
Nick Craig-Wood wrote: > Josiah Carlson <[EMAIL PROTECTED]> wrote: >> Sending results one at a time to the GUI is going to be slow for any >> reasonably fast search engine (I've got a pure Python engine that does >> 50k results/second without breaking a

Re: Python's handling of unicode surrogates

2007-04-21 Thread Josiah Carlson
On Apr 20, 7:34 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Apr 20, 6:21 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > > I don't believe this specific variant has been discussed. > > Now that you clarify it: no, it hasn't been discussed. I find that > > not surprising - this proposal

Re: regex question

2007-04-27 Thread Josiah Carlson
proctor wrote: > i have a regex: rx_test = re.compile('/x([^x])*x/') You probably want... rx_test = re.compile('/x([^x]*)x/') - Josiah -- http://mail.python.org/mailman/listinfo/python-list

Re: preferred windows text editor?

2007-05-12 Thread Josiah Carlson
T. Crane wrote: > Right now I'm using Notepad++. What are other people using? If you are looking for editors written in Python (that are generally multiplatform using wxPython), there are a few listed: http://wiki.wxpython.org/wxPythonPit_Apps . If you are looking for editors with Python suppo

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Josiah Carlson
Stefan Behnel wrote: > Anton Vredegoor wrote: >>> In summary, this PEP proposes to allow non-ASCII letters as >>> identifiers in Python. If the PEP is accepted, the following >>> identifiers would also become valid as class, function, or >>> variable names: Löffelstiel, changé, ошибка, or 売り場 >>> (

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Josiah Carlson
Daniel Nogradi wrote: > Caching? > from cPickle import dumps dumps('0') == dumps(str(0)) > True dumps('1') == dumps(str(1)) > True dumps('2') == dumps(str(2)) > True > > dumps('9') == dumps(str(9)) > True dumps('10') == dumps(str(10)) > False du

Re: Asyncore Help?

2007-05-16 Thread Josiah Carlson
Paul Kozik wrote: > I am working on the networking code for a small Multiplayer RPG I'm > working on. I currently have some basic code using threads, but it > seems like asyncore would be far better suited for my needs. However, > I have trouble finding a solid example for what I need. Python.org a

Re: Is wsgi ready for prime time?

2007-05-17 Thread Josiah Carlson
Ron Garret wrote: wsgiref.util > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'module' object has no attribute 'util' wsgiref.headers > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'module' object has no attribute 'headers

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-18 Thread Josiah Carlson
John Nagle wrote: >Many of the basic libraries for web related functions do have > problems. Even standard modules like "urllib" and "SSL" are buggy, > and have been for years. Outside the standard modules, it gets > worse, especially for ones with C components. Version incompatibility > for

Re: Components for a client/server architecture

2007-05-21 Thread Josiah Carlson
Samuel wrote: > On Mon, 21 May 2007 12:06:50 +0200, Diez B. Roggisch wrote: > >> I'm not sure which configuration you want to change how often. But I'm >> not convinced that the python threading limitations really do make a >> difference here. Do you really benefit from multi-core capabilities in

Re: A few questions

2007-05-21 Thread Josiah Carlson
Christopher Arndt wrote: > I have a few quibles with your summary of Python's properties: > On 21 Mai, 08:16, John Nagle <[EMAIL PROTECTED]> wrote: >> Memory management >> is safe and managed by reference counts backed by a garbage collector. >> Weak references are supported. Built in data types a

Re: decorators tutorials

2007-07-25 Thread Josiah Carlson
james_027 wrote: > hi bruno, > > That seems to be hard to read at all, or I am just very new to python? No, it's hard to read. Note that it's not, technically, necessary to use nested functions to get the same results as a particular decorator. For example, earlier you provided... def check

Re: How to tell when a socket is closed on the other end?

2007-07-25 Thread Josiah Carlson
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > billiejoex <[EMAIL PROTECTED]> wrote: > >> Hi there. >> I'm setting up test suite for a project of mine. >> >From test suite, acting as a client, I'd like to know, in certain >> situations, if the socket is closed on the other end or not. >> I

Re: How to tell when a socket is closed on the other end?

2007-07-26 Thread Josiah Carlson
Jay Loden wrote: > Roy Smith wrote: >> In article <[EMAIL PROTECTED]>, >> billiejoex <[EMAIL PROTECTED]> wrote: >> >>> Hi there. >>> I'm setting up test suite for a project of mine. >>> >From test suite, acting as a client, I'd like to know, in certain >>> situations, if the socket is closed on th

ANN: PyPE 2.8.6

2007-08-26 Thread Josiah Carlson
7;s home on the web: http://pype.sf.net/index.shtml If you have any questions about PyPE, please contact me, Josiah Carlson, aka the author of PyPE, at jcarlson at uci.edu (remember to include "PyPE" in the subject). PyPE 2.8.6 includes the following changes and bugfixes since rele

ANN: PyPE 2.8.5

2007-04-06 Thread Josiah Carlson
7;s home on the web: http://pype.sf.net/index.shtml If you have any questions about PyPE, please contact me, Josiah Carlson, aka the author of PyPE, at jcarlson at uci.edu (remember to include "PyPE" in the subject). PyPE 2.8.5 includes the following changes and bugfixes since re

ANN: PyPE 2.8.7

2007-09-25 Thread Josiah Carlson
7;s home on the web: http://pype.sf.net/index.shtml If you have any questions about PyPE, please contact me, Josiah Carlson, aka the author of PyPE, at jcarlson at uci.edu (remember to include "PyPE" in the subject). PyPE 2.8.7 includes the following changes and bug

ANN: PyPE 2.8.8

2007-09-30 Thread Josiah Carlson
7;s home on the web: http://pype.sf.net/index.shtml If you have any questions about PyPE, please contact me, Josiah Carlson, aka the author of PyPE, at jcarlson at uci.edu (remember to include "PyPE" in the subject). PyPE 2.8.7 includes the following changes and bug

Re: ANN: PyPE 2.8.7

2007-10-02 Thread Josiah Carlson
On Sep 26, 12:50 am, stef <[EMAIL PROTECTED]> wrote: > thebjorn wrote: > > On Sep 25, 12:37 pm, stef <[EMAIL PROTECTED]> wrote: > > >> Josiah Carlson wrote: > > >>> === What isPyPE? === > >>>PyPE(Python Programmers' Editor) was writ

Re: Adding idle timeout capabilities to asyncore

2007-10-23 Thread Josiah Carlson
On 22 Ott, 12:28, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > Hi there. > We're talking about an asyncore-based server. > Just for the heck of it I'd like to set a timeout which will > disconnects the clients if they're inactive (i.e., no command or data > transfer in progress) for a long period

Re: Adding idle timeout capabilities to asyncore

2007-10-24 Thread Josiah Carlson
On Oct 23, 9:30 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 23 Oct 2007 15:34:19 -0000, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > [snip] > > >Calling time.time() is relatively inexpensive in comparison to pure > >Python function calls,

Re: asynchat sends data on async_chat.push and .push_with_producer

2008-05-13 Thread Josiah Carlson
Ludvig, In a substantial way, I agree with you. Calling initiate_send() within push or push_with_producer is arguably a misfeature (which you have argued). In a pure world, the only writing that is done would be within the handle_send() callbacks within the select loop. Then again, in a perfect

Re: asynchat sends data on async_chat.push and .push_with_producer

2008-05-13 Thread Josiah Carlson
On May 13, 9:35 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > In a pure world, the only writing that is done would be within the > > handle_send() callbacks within the select loop. Then again, in a > > perfect world, calling readable() and writable() would have no strange > > side affects

Re: Doubts about how implementing asynchronous timeouts through a heap

2008-07-10 Thread Josiah Carlson
On Jul 9, 4:13 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to implement an asynchronous scheduler for asyncore to call > functions at a later time without blocking the main loop. > The logic behind it consists in: > > - adding the scheduled functions into a heapified list

Re: Doubts about how implementing asynchronous timeouts through a heap

2008-07-10 Thread Josiah Carlson
On Jul 10, 11:30 am, Josiah Carlson <[EMAIL PROTECTED]> wrote: > On Jul 9, 4:13 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I'm trying to implement an asynchronous scheduler for asyncore to call > > functions

Re: Doubts about how implementing asynchronous timeouts through a heap

2008-07-12 Thread Josiah Carlson
On Jul 9, 4:13 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to implement an asynchronous scheduler for asyncore to call > functions at a later time without blocking the main loop. > The logic behind it consists in: > > - adding the scheduled functions into a heapified list

Re: Questions about asyncore

2008-08-05 Thread Josiah Carlson
On Jul 29, 4:09 am, Frank Millman <[EMAIL PROTECTED]> wrote: > Hi all > > I have been using my own home-brewed client/server technique for a > while, using socket and select. It seems to work ok. The server can > handle multiple clients. It does this by creating a new thread for > each connection.

Re: Doubts about how implementing asynchronous timeouts through a heap

2008-08-05 Thread Josiah Carlson
On Jul 12, 12:16 pm, Josiah Carlson <[EMAIL PROTECTED]> wrote: > On Jul 9, 4:13 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I'm trying to implement an asynchronous scheduler forasyncoreto call > > functions

<    1   2