From jon+python-uk at unequivocal.co.uk Wed Feb 1 15:13:05 2006 From: jon+python-uk at unequivocal.co.uk (Jon Ribbens) Date: Wed, 1 Feb 2006 14:13:05 +0000 Subject: [python-uk] Turbogears In-Reply-To: <57a935970601271710i2aaed93cg@mail.gmail.com> References: <43D640D7.2090404@titanic.co.uk> <43D6466A.4000101@pigeonhold.com> <43D67E2D.4060608@titanic.co.uk> <43D7220B.5000607@isotoma.com> <43D72DF2.6080905@titanic.co.uk> <43D73707.1020002@isotoma.com> <43D73906.4080507@titanic.co.uk> <20060125145711.GE32638@snowy.squish.net> <57a935970601271710i2aaed93cg@mail.gmail.com> Message-ID: <20060201141305.GA29272@snowy.squish.net> Mamading Ceesay wrote: > IIRC, jonpy supports fastcgi amongst other things. I read a good > piece about fastcgi not too long ago: Yes, it lets you write your code once and run it without change using CGI, mod_python or FastCGI. I (or anyone) could make it do SCGI too but I've never heard of anyone using that. From jon+python-uk at unequivocal.co.uk Wed Feb 1 15:17:51 2006 From: jon+python-uk at unequivocal.co.uk (Jon Ribbens) Date: Wed, 1 Feb 2006 14:17:51 +0000 Subject: [python-uk] Turbogears In-Reply-To: <43D79C3F.1070600@titanic.co.uk> References: <43D640D7.2090404@titanic.co.uk> <43D6466A.4000101@pigeonhold.com> <43D67E2D.4060608@titanic.co.uk> <43D7220B.5000607@isotoma.com> <43D72DF2.6080905@titanic.co.uk> <43D73707.1020002@isotoma.com> <43D73906.4080507@titanic.co.uk> <20060125145711.GE32638@snowy.squish.net> <43D79C3F.1070600@titanic.co.uk> Message-ID: <20060201141751.GB29272@snowy.squish.net> Simon Faulkner wrote: > > You sound like the sort of person who should be using the one I wrote, > > http://jonpy.sf.net/ ;-) It's designed to be lightweight and easy to > > use as well as powerful (it's very simple, nothing like the complexity > > of Zope etc). > > > > Just a quick plug ;-) > > LOL - you should be on Parkinson with a plug like that! I think he just does books, not software :-p If I do say so myself, it does have some neat features, a transport-independent Servlet-style web application API, and the templating system has some ideas I have not seen anywhere else (including bloody-obvious ones like always HTML-encoding output by default that I think it's disgraceful they don't all do). > Are you going to the Manchester do? I would love a quick chat about it... Sorry, too far for me (I live in London). From ms at cerenity.org Wed Feb 1 16:08:32 2006 From: ms at cerenity.org (Michael Sparks) Date: Wed, 1 Feb 2006 15:08:32 +0000 Subject: [python-uk] Reminder: Python Meet Manchester 8th Feb, Lass O'Gowrie Message-ID: <200602011508.32669.ms@cerenity.org> Hi, Just a reminder that Python Meet Manchester is happening NEXT week. * Where: Lass O'Gowrie Pub. Directions: http://tinyurl.com/cp3kv * When: 7pm onwards, Wed 8th Feb I don't know if this'll be the first meetup for pythonistas that's happened in Manchester, but it'll be the first one I've been to there - should be fun :-) If you've been to one in London you know pretty much what to expect - a bunch of geeks in a pub talking, well, about python and stuff they find interesting. If you've used/written/found something you think's cool and want to talk about it & show it off please do. Sign up page (not obligatory, but would be nice if people did - it at least has my ugly mug on as a point of reference for people :-) here: * http://tinyurl.com/a9cry Current topics offered up for discussion: * Turbo Gears * Kamaelia (Similar problem space to twisted for people who don't know what it is, but very different - hopefully more newbie friendly) * How to write "Pythonically". (I'm convinced you need to be dutch for that one myself ;-) Also if you're vaguely interested in python, but are interested in other things like RoR, please come along - the London meets are interesting because of the eclectic mix of people/interests :-) Likewise if there's anything you'd be interested in seeing/hearing about, please come and chat about it :) Please feel free to forward this reminder around! See you there! Michael. From mwh at python.net Wed Feb 1 18:42:55 2006 From: mwh at python.net (Michael Hudson) Date: Wed, 01 Feb 2006 17:42:55 +0000 Subject: [python-uk] Reminder: Python Meet Manchester 8th Feb, Lass O'Gowrie References: <200602011508.32669.ms@cerenity.org> Message-ID: <2mlkwvf00w.fsf@starship.python.net> Michael Sparks writes: > Hi, > > > Just a reminder that Python Meet Manchester is happening NEXT week. > * Where: Lass O'Gowrie Pub. Directions: http://tinyurl.com/cp3kv > * When: 7pm onwards, Wed 8th Feb > > I don't know if this'll be the first meetup for pythonistas that's happened in > Manchester, but it'll be the first one I've been to there - should be fun :-) Hey, you are still alive! Have you been getting my emails recently? :) Cheers, mwh -- The above comment may be extremely inflamatory. For your protection, it has been rot13'd twice. -- the signature of "JWhitlock" on slashdot From ms at cerenity.org Wed Feb 1 20:49:27 2006 From: ms at cerenity.org (Michael Sparks) Date: Wed, 1 Feb 2006 19:49:27 +0000 Subject: [python-uk] Reminder: Python Meet Manchester 8th Feb, Lass O'Gowrie In-Reply-To: <2mlkwvf00w.fsf@starship.python.net> References: <200602011508.32669.ms@cerenity.org> <2mlkwvf00w.fsf@starship.python.net> Message-ID: <200602011949.28105.ms@cerenity.org> On Wednesday 01 February 2006 17:42, Michael Hudson wrote: ... > > I don't know if this'll be the first meetup for pythonistas that's > > happened in Manchester, but it'll be the first one I've been to there - > > should be fun :-) > > Hey, you are still alive! Have you been getting my emails recently? :) fx: *rummages* Oops! Sorry - I'll reply off list :-) fx: *beats spam filter with a wet haddock* Michael. From ajay_soni22 at hotmail.com Sun Feb 5 21:21:59 2006 From: ajay_soni22 at hotmail.com (AJAY SONI) Date: Sun, 05 Feb 2006 20:21:59 +0000 Subject: [python-uk] payment representative Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-uk/attachments/20060205/e1273c51/attachment.htm From lists at nabble.com Thu Feb 9 12:20:53 2006 From: lists at nabble.com (Shanon (sent by Nabble.com)) Date: Thu, 9 Feb 2006 03:20:53 -0800 (PST) Subject: [python-uk] Thread Dump of a python process Message-ID: <2840619.post@talk.nabble.com> Hi, I would to know if there're some way to have a dump of all the threads started by a python process. I want to see the TID corresponding of each thread because I need them to get the CPU time of each thread by the command top. Thanks -- View this message in context: http://www.nabble.com/Thread-Dump-of-a-python-process-t1089325.html#a2840619 Sent from the Python - python-uk forum at Nabble.com. From miles.chris at gmail.com Thu Feb 9 15:57:24 2006 From: miles.chris at gmail.com (Chris Miles) Date: Thu, 9 Feb 2006 14:57:24 +0000 Subject: [python-uk] Thread Dump of a python process In-Reply-To: <2840619.post@talk.nabble.com> References: <2840619.post@talk.nabble.com> Message-ID: <4E53BCDD-7B74-4F98-BCFC-5894390A8319@gmail.com> If you are using threading you can try: threading.enumerate() Cheers CM -- Chris Miles http://chrismiles.info/ On 9 Feb 2006, at 11:20, Shanon (sent by Nabble.com) wrote: > Hi, > > I would to know if there're some way to have a dump of all the threads > started by a python process. I want to see the TID corresponding of > each > thread because I need them to get the CPU time of each thread by > the command > top. From joanmikel at gmail.com Fri Feb 10 12:52:31 2006 From: joanmikel at gmail.com (Shanon) Date: Fri, 10 Feb 2006 03:52:31 -0800 (PST) Subject: [python-uk] Thread Dump of a python process In-Reply-To: <4E53BCDD-7B74-4F98-BCFC-5894390A8319@gmail.com> References: <2840619.post@talk.nabble.com> <4E53BCDD-7B74-4F98-BCFC-5894390A8319@gmail.com> Message-ID: <2868419.post@talk.nabble.com> Thank you for your info. Now I have read that a simple call os.getpid() returned the linux identifier of the thread in latest python versions, but I'm using Python 2.3 and 2.4 and this call returns always the same id Sad Sad I only want to take the pid of the thread but isn't as easier as it seems. -- View this message in context: http://www.nabble.com/Thread-Dump-of-a-python-process-t1089325.html#a2868419 Sent from the Python - python-uk forum at Nabble.com. From w.yang at dl.ac.uk Wed Feb 15 10:42:02 2006 From: w.yang at dl.ac.uk (Yang, W (Wanjuan)) Date: Wed, 15 Feb 2006 09:42:02 -0000 Subject: [python-uk] how to kill the server in program Message-ID: <6277F9B56BF0784884CC402CAF0CE67263B779@exchange04.fed.cclrc.ac.uk> Hello, I am building a server program. I have seen some examples like the following: import pickle import Queue import socket import threading # We'll pickle a list of numbers, yet again: someList = [ 1, 2, 7, 9, 0 ] pickledList = pickle.dumps ( someList ) # A revised version of our thread class: class ClientThread ( threading.Thread ): # Note that we do not override Thread's __init__ method. # The Queue module makes this not necessary. def run ( self ): # Have our thread serve "forever": while True: # Get a client out of the queue client = clientPool.get() # Check if we actually have an actual client in the client variable: if client != None: print 'Received connection:', client [ 1 ] [ 0 ] client [ 0 ].send ( pickledList ) for x in xrange ( 10 ): print client [ 0 ].recv ( 1024 ) client [ 0 ].close() print 'Closed connection:', client [ 1 ] [ 0 ] # Create our Queue: clientPool = Queue.Queue ( 0 ) # Start two threads: for x in xrange ( 2 ): ClientThread().start() # Set up the server: server = socket.socket ( socket.AF_INET, socket.SOCK_STREAM ) server.bind ( ( '', 2727 ) ) server.listen ( 5 ) # Have the server serve "forever": while True: clientPool.put ( server.accept() ) Since the server main thread and child thread will run forever, my question is how can I exit the server nicely in the program when it is required (e.g no clients coming for a while) rather than using 'Ctrl-c' or kill the process. another question is: Is that when the main thread is killed, then the child thread will stop as well? In this case, before killing the main thread, we have to make sure the child thread already finish its job. But how the main thread know whether the child thread finish the job or not. in other words, how does the main thread communicate the child thread? Anybody know? Thanks in advance! Best Wishes, Wendy Yang From miles.chris at gmail.com Wed Feb 15 11:27:36 2006 From: miles.chris at gmail.com (Chris Miles) Date: Wed, 15 Feb 2006 10:27:36 +0000 Subject: [python-uk] how to kill the server in program In-Reply-To: <6277F9B56BF0784884CC402CAF0CE67263B779@exchange04.fed.cclrc.ac.uk> References: <6277F9B56BF0784884CC402CAF0CE67263B779@exchange04.fed.cclrc.ac.uk> Message-ID: On 15 Feb 2006, at 09:42, Yang, W (Wanjuan) wrote: > > Since the server main thread and child thread will run forever, my > question is how can I exit the server nicely in the program when it > is required (e.g no clients coming for a while) rather than using > 'Ctrl-c' or kill the process. You can define signal handlers to clean things up and exit cleanly if a kill signal is sent to the process. See http://docs.python.org/lib/ module-signal.html > another question is: Is that when the main thread is killed, then > the child thread will stop as well? In this case, before killing > the main thread, we have to make sure the child thread already > finish its job. But how the main thread know whether the child > thread finish the job or not. in other words, how does the main > thread communicate the child thread? If you don't want the main thread to block on waiting for child threads to die before exiting cleanly, you can mark child threads as daemon threads using thread.setDaemon(1). See http://docs.python.org/ lib/thread-objects.html If you don't want your main thread to die before the child threads have cleanly finished, then make sure to setDaemon(0) and you may also need to signal the child threads that they need to cleanup and exit. A thread-safe method of doing this is to use a threading Event object. Create one object and set it to true when you want all the children to exit. The children need to periodically check the Event object and perform any cleanup if they find it set. See http:// docs.python.org/lib/event-objects.html Cheers, CM -- Chris Miles http://chrismiles.info/ From xtian at babbageclunk.com Thu Feb 16 11:09:41 2006 From: xtian at babbageclunk.com (xtian) Date: Thu, 16 Feb 2006 10:09:41 +0000 Subject: [python-uk] how to kill the server in program In-Reply-To: <6277F9B56BF0784884CC402CAF0CE67263B779@exchange04.fed.cclrc.ac.uk> References: <6277F9B56BF0784884CC402CAF0CE67263B779@exchange04.fed.cclrc.ac.uk> Message-ID: <8a420c070602160209m2fbf6023w93be676197aec038@mail.gmail.com> On 2/15/06, Yang, W (Wanjuan) wrote: > > Since the server main thread and child thread will run forever, my question is how can I exit the server nicely in the program when it is required (e.g no clients coming for a while) rather than using 'Ctrl-c' or kill the process. > > another question is: Is that when the main thread is killed, then the child thread will stop as well? In this case, before killing the main thread, we have to make sure the child thread already finish its job. But how the main thread know whether the child thread finish the job or not. in other words, how does the main thread communicate the child thread? > What Chris said about making the child thread a daemon is right. Another technique I've found useful when writing threaded servers like this is to use the timeout facility of sockets (in Python 2.3 onwards) - you can then have the child thread loop accepting connections *or* timing out, and checking a run flag to determine when you should stop. Something like (not tested): socket.setdefaulttimeout(0.5) class ServerThread(threading.Thread): def __init__(self, sock): threading.Thread.__init__(self) self.run = True self.sock = sock def please_stop(self): self.run = False def run(self): while self.run: try: conn, address = self.sock.accept() # do stuff with connection... except socket.timeout: pass # maybe track how many consecutive timeouts? # any cleanup can go here. I've found that having the timeout in there makes everything much easier to handle. Cheers, xtian From simon at brunningonline.net Tue Feb 21 15:26:37 2006 From: simon at brunningonline.net (Simon Brunning) Date: Tue, 21 Feb 2006 14:26:37 +0000 Subject: [python-uk] London Python etc. meetup, Monday March the 13th. Message-ID: <8c7f10c60602210626mb3936a7q79461b1441f41ac4@mail.gmail.com> -- Cheers, Simon B, simon at brunningonline.net, http://www.brunningonline.net/simon/blog/ From toshitst at terra.com.br Fri Feb 24 12:22:45 2006 From: toshitst at terra.com.br (Toshinobu Tasoko) Date: Fri, 24 Feb 2006 08:22:45 -0300 Subject: [python-uk] (no subject) Message-ID: <001601c63934$a29145b0$0300a8c0@TSTauditores.com> S?ria poss?vel reenviar-nos o arquivo zipado e a senha do programa novamente. Reformatei o meu winchester e preciso refazer tudo novamente. Muito obrigado, Toshinobu Tasoko Nota: O seu programa ? muito bom! J? indiquei para muita gente. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-uk/attachments/20060224/4d1e5e74/attachment.html From andy at reportlab.com Tue Feb 28 12:39:20 2006 From: andy at reportlab.com (Andy Robinson) Date: Tue, 28 Feb 2006 11:39:20 +0000 Subject: [python-uk] UK Python Conference - 19-22 April 2006 Message-ID: <44043668.6080204@reportlab.com> The ACCU is once again hosting a UK Python Conference on the above dates at the Randolph Hotel in Oxford. Sign up now..... http://www.accu.org/index.php/conferences/2006/schedule PROGRAMME ========= I am happy to announce that Guido van Rossum is once again a keynote speaker for the entire ACCU conference. Following his keynote we have a single, 2-day Python track on Wednesday and Thursday including... Steve Holden: The Best of PyCon Michael Hudson: Error Handling with Recovery Phil Thompson: PyQT 4 Michael Hudson: PyPy - a progress report Simon Willison: Django Remi Delon: CherryPy and TurboGears Chris Withers: Templating systems Andy Robinson: Metadata and models in Python Andrew Thompson: Financial Programming in Python ...and of course lightning talks and BOFS will be welcome.... Friday will feature a Dynamic Languages track with in-depth talks on Javascript, Ruby and Groovy, which I am sure will be of great interest to Python developers. PRE CONFERENCE PYTHON TUTORIAL: =============================== John Pinner will be giving a full day "Python for Programmers" tutorial on Tuesday prior to the main event. This tutorial is aimed at programmers who have no previous knowledge of Python but who would like to know more about it. If you want to convert your colleagues, this is where to send them.... ABOUT THE ACCU CONFERENCE ========================= For those not familiar with the event, the ACCU conference is one of the foremost gatherings of programming talent in the world, regularly featuring authors and major figures from the C/C++/C#/Java/Python and other communities. The cheapest way to attend is to join the ACCU This will be the LAST CHANCE to attend this fantastic event; after more than 5 years of being nurtured by the ACCU, the UK Python community will hopefully be organising a standalone conference in future years. Python talks will continue to be welcome (and we hope numerous) on the ACCU programme, but not as an advertised "mini-conference"; instead we'll be shifting focus to dynamic languages in general. Best Regards, Andy Robinson ACCU Conference Committee From pdr at pdr.cx Mon Feb 27 22:51:37 2006 From: pdr at pdr.cx (Pete Ryland) Date: Mon, 27 Feb 2006 21:51:37 +0000 Subject: [python-uk] (no subject) In-Reply-To: <001601c63934$a29145b0$0300a8c0@TSTauditores.com> References: <001601c63934$a29145b0$0300a8c0@TSTauditores.com> Message-ID: <20060227215137.GB25097@pdr.cx> Oi Toshinobu, Primeiramente, esta ? uma lista dedicada aos usu?rios do python no Reino Unido, e ? conseq?entemente uma lista da l?ngua inglesa. Se voc? est? falando sobre o python, a seguir voc? pode buscar o arquivo apropriado de http://www.python.org/ que n?o deve reque nenhuma senha. Voc? n?o deve ter que reformater seu winchester. Pete Hi Toshinobu, Firstly, this list is dedicated to python users in the UK, and so is an English-only list. If you are talking about python, then you can get the appropriate file from http://www.python.org/ which doesn't require a password. You shouldn't have to reformat your hard drive. Pete On Fri, Feb 24, 2006 at 08:22:45AM -0300, Toshinobu Tasoko wrote: > S?ria poss?vel reenviar-nos o arquivo zipado e a senha do programa > novamente. Reformatei o meu winchester e preciso refazer tudo novamente. > > > Muito obrigado, > > Toshinobu Tasoko > > > Nota: O seu programa ? muito bom! J? indiquei para muita gente.