Re: ANN: pyTenjin 0.8.0 - much faster template engine than Django

2009-06-17 Thread Igor Katson
kwatch wrote: I have released pyTenjin 0.8.0 Thanks for your project. I have used it a little, and there is a question to you. import tenjin from tenjin.helpers import * shared_cache = tenjin.GaeMemcacheCacheStorage() engine = tenjin.Engine(cache=shared_cache) 1. Why should I import tenjin

What is the purpose of "struct" and "array" modules

2009-05-28 Thread Igor Katson
I pretty much understand what they do, but what's the case of using these modules by example? Is it something like pickle, to store the data efficiently in files? -- http://mail.python.org/mailman/listinfo/python-list

Re: A fast way to read last line of gzip archive ?

2009-05-27 Thread Igor Katson
So in summary, the choices when tested on my system ended up at: last 26 last-chunk2.7 last-chunk-2 2.3 last-popen1.7 last-gzip 1.48 last-decompress 1.12 So by being willing to mix in some more direct code with the GzipFile ob

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-24 Thread Igor Katson
Roy Smith wrote: In article , Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have written a socket server and some arbitrary clients. When I shutdown the server, and do socket.close(), I cannot immediately start it again cause it has some open sockets in TIME

Re: Multiprocessing and file I/O

2009-05-24 Thread Igor Katson
Infinity77 wrote: Hi All, I am trying to speed up some code which reads a bunch of data from a disk file. Just for the fun of it, I thought to try and use parallel I/O to split the reading of the file between multiple processes. Although I have been warned that concurrent access by multiple

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-24 Thread Igor Katson
Igor Katson wrote: I have written a socket server and some arbitrary clients. When I shutdown the server, and do socket.close(), I cannot immediately start it again cause it has some open sockets in TIME_WAIT state. It throws address already in use exception at me. I have searched for that in

How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-24 Thread Igor Katson
I have written a socket server and some arbitrary clients. When I shutdown the server, and do socket.close(), I cannot immediately start it again cause it has some open sockets in TIME_WAIT state. It throws address already in use exception at me. I have searched for that in google but haven't f

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-17 Thread Igor Katson
Gabriel Genellina wrote: En Sat, 16 May 2009 04:04:03 -0300, Igor Katson escribió: Gabriel Genellina wrote: En Fri, 15 May 2009 09:04:05 -0300, Igor Katson escribió: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: Lawrence D'Oliveiro wrote: In message , Igor Katson w

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-16 Thread Igor Katson
Gabriel Genellina wrote: En Fri, 15 May 2009 09:04:05 -0300, Igor Katson escribió: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have problems in getting a SocketServer to shutdown. Do you want to do a s

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Igor Katson
Gabriel Genellina wrote: En Fri, 15 May 2009 09:04:05 -0300, Igor Katson escribió: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have problems in getting a SocketServer to shutdown. Do you want to do a s

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Igor Katson
Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have problems in getting a SocketServer to shutdown. Do you want to do a shutdown or a close? I want the server close

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Igor Katson
Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have problems in getting a SocketServer to shutdown. Do you want to do a shutdown or a close? I want the server close the socket, and the program to continue after that (in this case, just to terminate). --

KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Igor Katson
I have problems in getting a SocketServer to shutdown. Why does this not actually stop the application? from SocketServer import UnixStreamServer, BaseRequestHandler server = UnixStreamServer('/tmp/ss.sock', BaseRequestHandler) try: server.serve_forever() except KeyboardInterrupt: server.