PMW widget - skip tabbing to it

2007-03-26 Thread jp
I have multiple PMW widgets (EntryFields, ScrolledField etc), how can I skip over these widgets when using the tab key? Thank you, John -- http://mail.python.org/mailman/listinfo/python-list

Re: PMW widget - skip tabbing to it

2007-03-26 Thread jp
On Mar 26, 11:17 am, [EMAIL PROTECTED] wrote: > On Mar 26, 10:51 am, "jp" <[EMAIL PROTECTED]> wrote: > > > I have multiple PMW widgets (EntryFields, ScrolledField etc), how can > > I skip over these widgets when using the tab key? > > > Thank you, >

Re: PMW widget - skip tabbing to it

2007-03-26 Thread jp
On Mar 26, 11:27 am, [EMAIL PROTECTED] wrote: > On Mar 26, 11:17 am, [EMAIL PROTECTED] wrote: > > > On Mar 26, 10:51 am, "jp" <[EMAIL PROTECTED]> wrote: > > > > I have multiple PMW widgets (EntryFields, ScrolledField etc), how can > > >

Re: PMW widget - skip tabbing to it

2007-03-26 Thread jp
On Mar 26, 12:34 pm, [EMAIL PROTECTED] wrote: > On Mar 26, 11:35 am, "jp" <[EMAIL PROTECTED]> wrote: > > > > > On Mar 26, 11:27 am, [EMAIL PROTECTED] wrote:> On Mar 26, 11:17 am, [EMAIL > > PROTECTED] wrote: > > > > > On Mar 26, 10

Re: PMW widget - skip tabbing to it

2007-03-27 Thread jp
On Mar 26, 5:41 pm, John McMonagle <[EMAIL PROTECTED]> wrote: > jp wrote: > >>> On Mar 26, 10:51 am, "jp" <[EMAIL PROTECTED]> wrote: > >>>> I have multiple PMW widgets (EntryFields, ScrolledField etc), how can > >>>> I skip over

ANN: nose 0.9.2 released

2007-01-31 Thread JP
nose is a discovery-based unittest extension that provides an alternate test discovery and running process for unittest, one that is intended to mimic the behavior of py.test as much as is reasonably possible without resorting to too much magic. nose 0.9.2 includes quite a few bug fixes and new fe

cmd i/o stream module

2012-06-27 Thread prakash jp
Hi All, I am interested to interact with the command prompt, is there a module to control the input/output stream. Thanks in advance for the pointers Thanks Prakash -- http://mail.python.org/mailman/listinfo/python-list

get latest from svn

2012-06-01 Thread prakash jp
Hi All, Can some one suggest me a module to access SVN repository so that i could download any given branch. Thanks -- http://mail.python.org/mailman/listinfo/python-list

help on QUICKFIX

2011-06-10 Thread prakash jp
Hi, I am using quickfix, would like to start with that ..\quickfix-1.13.3\quickfix\examples\executor\python\executor.py asks for a configuration file how should it look like. Thanks -- http://mail.python.org/mailman/listinfo/python-list

find max and min values from a column of a csv file

2011-07-07 Thread prakash jp
Hi All , Could any one help to get max and min values from a specified column of a csv file. The* csv file is large* and hence the below code did go bad. *Alternate methods would be highly appreciated ** minimum.py*: import csv filename = "testLog_4.csv" f = open(filename) def col_min(mincname):

Re: find max and min values from a column of a csv file

2011-07-19 Thread prakash jp
Thanks for the suggestions. Felt the thread could be of help on consolidating the solution. *Max Value from a csv column:* import numpy data1 = numpy.genfromtxt("data.csv",dtype='float',delimiter = ',',skiprows=1, skip_header=0, skip_footer=0, usecols=11,usemask=True) #pri

how to invoke a bat file on a remote machine

2011-08-07 Thread prakash jp
Hi all, Want to know how to invoke a bat file on a remote machine. Thanks -- http://mail.python.org/mailman/listinfo/python-list

pydev ant build

2011-05-30 Thread prakash jp
Hi all, Could any one provide relevant url/s on the usage of *pyant* scripts and its setup as well Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Metaclasses, decorators, and synchronization

2005-09-25 Thread Jp Calderone
lock creation. This is exactly what Twisted's implementation does. You can read that version at <http://svn.twistedmatrix.com/cvs/trunk/twisted/python/threadable.py?view=markup&rev=13745>. The code is factored somewhat differently: the functionality is presented as pre- and post-execution hooks, and there is function decorator. The concept is the same, however. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature Proposal: Sequence .join method

2005-09-30 Thread Jp Calderone
0,range(10))) > [0, 100, 1, 100, 2, 100, 3, 100, 4, 100, 5, 100, 6, 100, 7, 100, 8, 100, 9] > >>> > >but I can't think of a use for it ;-) I have this version: def interlace(x, i): """interlace(x, i) -> i0, x, i1, x, ..., x, iN

Re: Dynamical loading of modules

2005-10-03 Thread Jp Calderone
;s name is a pointer to where it is defined: this is useful because it saves a lot of grepping, and unambiguously tells the reader where the class came from. If you start making it mean something else, you'll end up confusing people. If you just want a pretty name, use something /other/ than the class's fully qualified Python name. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: how to debug when "Segmentation fault"

2005-10-04 Thread Jp Calderone
def mro(self): ... return [float] ... >>> class bar: ... __metaclass__ = foo ... Segmentation fault [EMAIL PROTECTED]:~$ python Python 2.4.2c1 (#2, Sep 24 2005, 00:48:19) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 Type "help", "copyright&q

Re: updating local()

2005-10-05 Thread Jp Calderone
er >words: probably the whole program could be taken over by other code by >just one call to that function. > If I can call functions in your process space, I've already taken over your whole program. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda evaluation

2005-10-06 Thread Jp Calderone
" so that it is always the >case that d[1](3) = 3? There are several ways, but this one involves the least additional typing: >>> d = {} >>> for x in 1, 2, 3: ... d[x] = lambda y, x=x: y * x ... >>> d[1](3) 3 Who needs closures, anyway? :) Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Python reliability

2005-10-09 Thread Jp Calderone
point, I've had python programs run on linux for more than a year using both Python 2.1.3 and 2.2.3. These were network apps, with both client and server functionality, using Twisted. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Python reliability

2005-10-09 Thread Jp Calderone
a.html > This reminds me of crash-only software: http://www.stanford.edu/~candea/papers/crashonly/crashonly.html Which seems to have some merits. I have yet to attempt to develop any large scale software explicitly using this technique (although I have worked on several systems that very loosely used this approach; eg, a server which divided tasks into two processes, with one restarting the other whenever it noticed it was gone), but as you point out, there's certainly precedent. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with cPickle for deserializing datetime.datetime instances

2005-10-14 Thread Jp Calderone
Pickle.dumps(Numeric.array([datetime.datetime.now() for n in >>> range(50)]))) Segmentation fault [EMAIL PROTECTED]:~$ Values smaller than 50 randomly mangle memory, but sometimes don't segfault the interpreter. You can get exciting objects like instances of cPickle.Pdata or refcnt back from the loads() call in these cases. So, the summary is, don't do this. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: write a loopin one line; process file paths

2005-10-18 Thread Jp Calderone
6750617468730a'.decode('hex')) Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: python gc performance in large apps

2005-10-22 Thread Jp Calderone
memory in 1.3, but has been fixed since 2.0; and Nevow 0.4.1 made it easy to write applications that leaked several page objects per request, which has been fixed since 0.5. If you're using either of these older versions, upgrading may fix your difficulties. Hope this helps, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: KeyboardInterrupt vs extension written in C

2005-10-22 Thread Jp Calderone
the signal occurs. > > Note that "longjmp" is dangerous. Great care is necessary. > > It is likely that SIGINT occurrences will lead to big > resource leaks (because your C extension will have no > way to release resources when it gets quit with "longjmp"). > Note that swapcontext() is probably preferable to longjmp() in almost all circumstances. In cases where it isn't, siglongjmp() definitely is. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: High Order Messages in Python

2005-10-22 Thread Jp Calderone
n, we usually don't call them messages. Instead, "functions" or sometimes "methods". Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: High Order Messages in Python

2005-10-22 Thread Jp Calderone
benefit(50) Or: [cl.receive_benefit(50) for cl in claimaints if cl.retired()) Or: map( ClaimaintType.receive_benefit, filter( ClaimaintType.retired, claimaints), itertools.repeat(50)) Or: claimaintGroup.disburse() Jp -- http://mail.python.org/mailman/listinfo/python-list

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: what is lambda used for in real code?

2004-12-31 Thread Jp Calderone
-) >>> print type('', (object,), {'foo': lambda self: 'spam'})().foo() spam Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 288 ponderings

2005-01-01 Thread Jp Calderone
y are available as a third party extension, and unfortunately are not terribly well documented yet (but luckily they are quite simple). http://codespeak.net/svn/user/arigo/greenlet/ Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Continuations Based Web Framework - Seaside.

2005-01-02 Thread Jp Calderone
ement between frameworks simpler for application developers. Of course, it may not, since it ignores complex things (it certainly comes nowhere close to addressing the requirements for a Seaside-alike), and any developer who wants to remain portable will not be able to take advantage of this technique. Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-01-04 Thread Jp Calderone
le, there is the zlib codec, the rot13 codec, and applications can define their own codecs with arbitrary behavior. It's entirely possible to write a codec that decodes _from_ unicode objects _to_ unicode objects and encodes the same way. So unicode objects need both methods to support this use case. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Hlelp clean up clumpsy code

2005-01-04 Thread Jp Calderone
for subx in flatten(subseq): yield subx to avoid catching TypeErrors from .next(). Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: get the IP address of a host

2005-01-06 Thread Jp Calderone
raise Exception > > It returns the IP address with which it connects to the world (not lo), > might be a pvt LAN address or an internet routed IP. Depend on where the > host is. > > I hate the google trick actually, so any suggestions to something better > is always welcome. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting on keys in a list of dicts

2005-01-06 Thread Jp Calderone
. > In Python 2.4, import operator L.sort(key=operator.itemgetter(key)) In Python 2.3, L2 = [(d[key], i, d) for (i, d) in enumerate(L)] L2.sort() L = [d for (v, i, d) in L2] Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding a restricted python interpreter

2005-01-06 Thread Jp Calderone
ng provider's excuse for not allowing you to use mod_python is completely bogus. All the necessary security tools for that situation are provided by the platform in the form of process and user separation. Jp -- http://mail.python.org/mailman/listinfo/python-list

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 complete

Re: Asyncore

2005-01-07 Thread Jp Calderone
tml Then check out: http://www.twistedmatrix.com/ Hope this helps, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-08 Thread Jp Calderone
nrelated processes, no doubt SMP is a big win automatically, but there will still need to be language innovations to make it easier to develop software which can benefit from the additional hardware for the more common case of individual CPU hungry processes. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: smtplib and TLS

2005-06-21 Thread Jp Calderone
ult here lies on gmail's end, but it is also possible that the fault is in your code or the standard library ssl support. Unless you want to dive into Python's OpenSSL bindings or start examining network traces of SSL traffic, you probably won't be able to figure out who'

Re: Hardening enviroment by overloading __import__?

2005-06-23 Thread Jp Calderone
port__ is what you need to replace. Note, of course, that this only makes it trivially more difficult for malicious code to do destructive things: it doesn't even prevent the code from importing any module it likes, it just makes it take a few extra lines of code. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: webserver application (via Twisted?)

2005-06-24 Thread Jp Calderone
p://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-06-24 Thread Jp Calderone
t* call accept(). Telnet (or connect somehow) repeatedly, until your connection is not accepted. On my system (Linux 2.6.10), I can connect successfully 8 times before the behavior changes. Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-06-24 Thread Jp Calderone
re more or less the same. If there is more than one file descriptor, though, the difference should be apparent. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Background thread

2005-06-25 Thread Jp Calderone
self.sendLine("You're taking too long!") def lineReceived(self, line): self.resetTimeout() self.sendLine("Thank you for the line of input!") from twisted.internet import reactor, stdio stdio.StandardIO(AnnoyProtocol()) reactor.run() For fancy line editing su

Re: a dictionary from a list

2005-06-25 Thread Jp Calderone
cumentation on the dict() constructor. Why does it >support keyword arguments? > > dict(foo="bar", baz="blah") ==> {"foo":"bar", "baz"="blah"} > >This smacks of creeping featurism. Is this actually useful in real code? Constantly. Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-06-28 Thread Jp Calderone
diately closes the accepted connection. If you do this (perhaps in conjunction with calling stopListening() on the port returned by listenXYZ()), you'll never overrun the 64 object limit. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: importing packages from a zip file

2005-06-29 Thread Jp Calderone
ted the soln again, it works but feels nasty Including paths in source files is a disaster. As soon as you do it, you need to account for alternate installation schemes by rewriting portions of your source files. Separating path names from module names lets you avoid most of this mess. Jp -- h

Re: python broadcast socket

2005-06-29 Thread Jp Calderone
ermission denied') >>> s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) >>> s.sendto('asdljk', ('255.255.255.255', 12345)) 6 >>> Yep, looks like it. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Scket connection to server

2005-06-30 Thread Jp Calderone
, 2)) >s.send("Hello, Mum\r\n") s.sendall("Hello, Mum\r\n") > >That should point you in the right direction, anyway. > >There is a higher level socket framework called twisted that >everyone seems to like. It may be worth looking at that too - >haven't got round to it myself yet. Twisted is definitely worth checking out. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-07-01 Thread Jp Calderone
al >object semantics. Smalltalk supports this with the "become" message. I have also done an implementation of this for Python. Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-07-01 Thread Jp Calderone
erator = iter() while True: try: = iterator.next() except StopIteration: break else: Let's get rid of for, too. Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-07-02 Thread Jp Calderone
ccum,i) In either case, you want to write: i = iter(g) _accum = i.next() for elem in i: _accum = stuff(_accum, elem) You also want to catch the StopIteration from that explicit .next() call, but that's an unrelated matter. Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-07-03 Thread Jp Calderone
eir own time to try to further the Python language. Suggesting people can "like it or lump it" is a disservice to everyone. (Sorry to single you out Peter, I know you frequently contribute great content to these discussions too, and that there are plenty of other people who respond in the way you have in this message, but I had to pick /some/ post to reply to) Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Using regular expressions in internet searches

2005-07-03 Thread Jp Calderone
ot;Michael." > >(1) Is Python the best language for this? (Plus is it time-efficient?) >Is there already a search engine that can do this? > >(2) How can I search multiple web pages within a single location or >path? > >TIA, > >Mike > Is a google search

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: looping over a big file

2005-07-03 Thread Jp Calderone
line_after = big_file.readline() > Yes, but you need to do it like this: fileIter = iter(big_file) for line in fileIter: line_after = fileIter.next() Don't mix iterating with any other file methods, since it will confuse the buffering scheme. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Use cases for del

2005-07-06 Thread Jp Calderone
mes a global is the simplest >way to do something... how do I delete a global if not with "del"? > Unless you are actually relying on the global name not being defined, "someGlobal = None" would seem to do just fine. Relying on the global name not being defined seems like an edge case. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: DNS access

2005-07-13 Thread Jp Calderone
er ? > Not using the built-in hostname resolution functions. There are a number of third-party DNS libraries: http://devel.it.su.se/projects/python-dns/ http://pydns.sourceforge.net/ http://dustman.net/andy/python/adns-python/ http://twistedmatrix.com/projects/names/ Jp -- http:/

Re: DNS access

2005-07-13 Thread Jp Calderone
The site you referenced points this out, too: """ Reverse DNS entries are set up with PTR records (whereas standard DNS uses A records), which look like "25.2.0.192.in-addr.arpa. PTR host.example.com" (whereas standard DNS would look like "host.example.com. A 192.0.2.25"). """ Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: threads and sleep?

2005-07-14 Thread Jp Calderone
to the list sometimes, and raise ValueErrors from the list.remove() call sometimes. Java's model isn't really too far from the traditional one. It's a tiny bit safer, perhaps, but that's all. For something different, take a look at Erlang's mechanism (this has bee

Re: how to get rate of pop3 receiving progress?

2005-07-14 Thread Jp Calderone
of how you might do this using Twisted's POP3 client support is attached. Jp pop3progress.py Description: application/python -- http://mail.python.org/mailman/listinfo/python-list

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: Need to interrupt to check for mouse movement

2005-07-20 Thread Jp Calderone
for the grandparent poster. > >Since blocking network IO is generally slow, this should help the >grandparent poster -- I am presuming that "the program updating itself" >is an IO-bound, rather than processor-bound process. In the particular case of wxWidgets, it turns o

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-21 Thread Jp Calderone
>from the window system. I expect that Qt and Tk work the same way. But not Gtk? :) I meant what I said: wxWidgets behaves differently in this regard than Gtk, Qt, and Tk. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Jp Calderone
he UI events -- the toolkit will for >example use select() to wait for X11 socket I/O, so it can also >respond to incoming data on another socket, provided along with a >callback function by the application. > >Am I hearing that wxWindows or other popular toolkits don't

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: Buffering problem using subprocess module

2005-07-21 Thread Jp Calderone
(generally the nicest) is to use a PTY instead of a pipe: when the C library sees stdout is a pipe, it generally decides to put output into a different buffering mode than when it sees stdout is a pty. I'm not sure how you use ptys with the subprocess module. Hope this helps, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Stupid question: Making scripts python-scripts

2005-07-21 Thread Jp Calderone
distutils will rewrite the #! line to fit the configuration of the system the program is being installed on. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding a built-in exception handler

2005-07-21 Thread Jp Calderone
but I only see good info on how to create my own class >of exception; I don't see anything on how to override an existing >exception handler. > >Thanks in advance for any help. See excepthook in the sys module documentation: http://python.org/doc/lib/module-sys.html Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Problem

2005-07-24 Thread Jp Calderone
cape') '\\n\\xfe' >>> '\\n\\xfe'.decode('string-escape') '\n\xfe' >>> Introduced in Python 2.3 Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-08-02 Thread Jp Calderone
re typically easy to terminate at arbitrary times. Jp -- http://mail.python.org/mailman/listinfo/python-list

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: Basic Server/Client socket pair not working

2005-08-29 Thread Jp Calderone
oblematic too, since it means you will only be able to send one message for each message received from the server, and vice versa. Most chat sessions don't play out like this. > >print msg I encourage you to take a look at Twisted. It takes care of all these little details in a cross-platform manner, allowing you to focus on your unique application logic, rather than solving the same boring problems that so many programmers before you have solved. Hope this helps, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: python and ajax

2005-08-29 Thread Jp Calderone
org/svn/Nevow/trunk/examples/livepage/livepage.py It's not a tutorial by itself, but if you poke around some of the other examples and read http://divmod.org/projects/nevow and some of the documents it references, you should be able to figure things out. Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-08-29 Thread Jp Calderone
you have it. It's a bit longer, but that's mostly due to the comments. The runCmd function has a slightly different signature too, since spawnProcess can control a few more things than Popen3, so it makes sense to make those features available (these include setting up the chil

Re: Sockets: code works locally but fails over LAN

2005-08-31 Thread Jp Calderone
ward.tap won't print out all the bytes it receives (I assume this is just for debugging purposes anyway - if not, a simple modification will cause it to do this). portforward.tap won't non-deterministically drop traffic, since Twisted checks the return value of send() and properly re-transmits anything which has not actually been sent. Hope this helps, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: threading.Thread vs. signal.signal

2005-09-17 Thread Jp Calderone
he behavior you wanted: while not t.done: time.sleep(1) Incidentally, the last 3 lines of ctrl_c_handler aren't really necessary. That said, here's a simpler version of the same program, using Twisted: import datetime from twisted.internet import reactor, task def hello(): print datetime.datetime.now() task.LoopingCall(hello).start(1, now=False) reactor.run() Hope this helps! Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2005-09-17 Thread Jp Calderone
this isn't the write newsgroup to post on, >but it's the only one I know of. IF anyone knows a good newsgroup, I'd >appreciate it. > >TIA The __del__ method is not a reliable cleanup mechanism. It runs when an object is garbage collected, but garbage collection is unpred

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

2005-09-20 Thread Jp Calderone
de. Me being dumb or bug? > >Any comments welcome :) > You need two ARC4 instances. Performing any operation alters the internal state (as it is a stream cipher), which is why your bytes did not come out intact. >>> import Crypto.Cipher.ARC4 as ARC4 >>> o = ARC4.new('hello monkeys') >>> p = ARC4.new('hello monkeys') >>> p.decrypt(o.encrypt('super secret message of doom')) 'super secret message of doom' >>> Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading, real or simulated?

2005-09-21 Thread Jp Calderone
hreading.Thread, this is a native thread. It is not a simulation. Something else is going wrong. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: [PATCH] Re: frozenset() without arguments should return a singleton

2005-02-12 Thread Jp Calderone
3.5c1 (#2, Feb 4 2005, 10:10:56) [GCC 3.3.5 (Debian 1:3.3.5-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> long() is long() False >>> Jp -- http://mail.python.org/mailman/listinfo/python-list

Sequence of empty lists

2005-02-22 Thread JP. Baker
I give up (and have prepared myself for replies telling me which search strings to use on Google etc)! How *should* I create a sequence of N empty lists (buckets)? I obviously can't use a = [[]]*N and I have found various solutions and am currently using a = map(lambda x: [], range(N)) but ca

Re: Replacing words from strings except 'and' / 'or' / 'and not'

2004-11-28 Thread Jp Calderone
t;> Sets are implemented using dictionaries, so the "if w in KEYWORDS" > > >> part would be O(1) instead of O(n) as with lists... > > >> > > >> (I.e. searching a list is a brute-force operation, whereas > > >> sets are not.

Re: Closing files

2004-11-28 Thread Jp Calderone
m/search?q=site%3Amail.python.org+file+closing Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: asynchat and threading

2004-11-29 Thread Jp Calderone
e > relatively distribution portable. > > One can also handle upgrades of the core image of Python and ancillary > packages as well by leaving a breadcrumb file indicating which packaging > system is native and the package currently installed. <<- idea needs wor

Re: Class methods in Python/C?

2004-11-30 Thread Jp Calderone
at you want. Guido wrote it himself, and even he ended up not using > it) Funny, I find the exact opposite to be the case... ;) Static methods are glorified free functions, but class methods participate usefully in inheritence hierarchies - why would anyone want the former? Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: SOAPpy/ZSI/Twisted SOAP over stdin/stdout?

2004-11-30 Thread Jp Calderone
l over stdio. Check out http://twistedmatrix.com/documents/current/examples/stdin.py and http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: module imports and memory usage

2004-11-30 Thread Jp Calderone
ny (_many_) more modules than you ever use at once. On a reasonable platform, if your program is sleeping, much of the memory it uses will be swapped out, especially if other processes need it. Are you sure you have good reason to be concerned over the size of the program? Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP generic objects

2004-11-30 Thread Jp Calderone
;", line 1, in ? TypeError: __init__() got multiple values for keyword argument 'self' __self would be better; a version that doesn't preclude the use of any key would be best. Jp -- http://mail.python.org/mailman/listinfo/python-list

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

2004-12-01 Thread Jp Calderone
ard to parse Perl regex' Twisted's IMAP4 support includes an implementation of this codec. Most of the API also happily accepts unicode objects and encodes them as necessary, too. http://www.twistedmatrix.com/ Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: non blocking read()

2004-12-01 Thread Jp Calderone
b = fileObj.read(1024) bytes.append(b) if len(b) < 1024: break return ''.join(bytes) Jp -- http://mail.python.org/mailman/listinfo/python-list

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

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Jp Calderone
oftware can you ask for? And even if there are packages that aren't available, don't you think effort put into a packaging system would better be put into apt than an entirely new system that is guaranteed to be less useful than apt for many years? Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP generic objects

2004-12-02 Thread Jp Calderone
ly those, a descriptor is created which will produce bound and unbound methods. Instances of other types, such as or , are ignored, leading to the critical difference in this case: >>> X().a >>> X().b > >>> No bound method for getattr, hence trying to call it with two arguments fails, as it has no self on which to operate. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: decorators ?

2004-12-02 Thread Jp Calderone
essage-thread-to-rehash-all-the-same-arguments'ly, Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: finding byte order

2004-12-03 Thread Jp Calderone
omposed in a way that you can infer the endianess > by reading e.g. a header at the beginning that has well-known fields, then > it might work. But only you can do that. > > For a pure binary file, there is absolutely no way of telling the endianess. I think you misread the question. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: using cmd.exe as a telnet client

2004-12-03 Thread Jp Calderone
in 1.3 and the version that will be in 2.0), which actually supports option negotiation in a reasonable way. Jp -- http://mail.python.org/mailman/listinfo/python-list

Re: using cmd.exe as a telnet client

2004-12-04 Thread Jp Calderone
ect(('some_server', some_port)) > client.modules.shutil().rmtree('/tmp/blah') This seems terribly, terribly insecure; the kind of thing no one should ever run on any server or desktop anywhere for any reason. What am I missing? Jp -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >