From syd at plug.ca Fri Jun 22 11:43:00 2007 From: syd at plug.ca (Sydney Weidman) Date: Fri, 22 Jun 2007 10:43:00 -0500 Subject: [Python Wpg] Next meeting reminder Message-ID: <1182526980.3565.23.camel@localhost.localdomain> Just a reminder that the next meeting of the Winnipeg Python Users Group is going to be held at room 2M70, University of Winnipeg at 7:30 PM next Wednesday (June 27th). This meeting's topic is "Batteries Included: A Tour of the Python Library" and we need your help!! If you'd like to give a short (10 or 15 minute) presentation on one or two standard library modules, please sign up by editing the Presenter Sign Up page: http://wiki.python.org/moin/PresenterSignUp or reply to the list with the module you intend to cover. Remember, it doesn't have to be fancy, just a basic run-through of the module's use. So far, only Jason Hildebrand and myself have signed up to give presentations. Come on, pythonistas! There's lots more library to cover! Directions: Room 2M70 is on the second floor of the University in Manitoba Hall. >From the main doors in Centennial Hall, go up the escalator one floor, take the first right through the archway into Manitoba Hall, then turn left and proceed down the corridor. 2M70 will be on your right about 1/3 of the way down the corridor. For those of you who would like to navigate via maps, here is the link to follow: http://www.uwinnipeg.ca/index/maps See you there! Regards, Syd Weidman From hockeysk8 at gmail.com Mon Jun 25 03:14:11 2007 From: hockeysk8 at gmail.com (Kevin J. Smith) Date: Mon, 25 Jun 2007 00:14:11 -0700 Subject: [Python Wpg] Looking for a python programmer with web (xhtml & css) skills In-Reply-To: <1ee0630e0706250011v18862b7eo78ebfc774024e46@mail.gmail.com> References: <1ee0630e0702061350id61062en5180f2405f4459a3@mail.gmail.com> <1ee0630e0706250007s2a575952nb30aff964f6e1b25@mail.gmail.com> <1ee0630e0706250011v18862b7eo78ebfc774024e46@mail.gmail.com> Message-ID: <1ee0630e0706250014n31b88840k213dc6ad5b2c3ced@mail.gmail.com> Hi, I have previously posted on Craigslist for a python programmer but didn't get much of a response. Therefore I thought I might scare up some more people on this list. My apologies to anyone who thinks this isn't an appropriate place to post for a Python programmer. I am looking for someone that is proficient in python and web development technologies such as xhtml, css, and javascript. You should have a good grasp of object oriented design and some understanding of HTTP. You will be revising an already completed web application that is built atop a python web development framework similar to Django (it is an in-house framework that I intend to release as open source once it is mature enough to avoid ridicule!) The code needs to be ported due to changes in the underlying framework and the fairly inefficient way that it was originally coded. You will have to change a number of pages from some very old crufty nested tables to css driven layout. If you are interested please reply to me personally at kevin at rootsmith.cawith your experience and expected compensation. There is somewhere between one and two months worth of work. Cheers -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason at peaceworks.ca Tue Jun 26 22:02:57 2007 From: jason at peaceworks.ca (Jason Hildebrand) Date: Tue, 26 Jun 2007 22:02:57 -0400 (EDT) Subject: [Python Wpg] Next meeting reminder In-Reply-To: <1182526980.3565.23.camel@localhost.localdomain> Message-ID: <6480220.5121182909777617.JavaMail.root@zimbra> Hi folks, It's great to see that several others have signed up for presenting on Batteries Included. I was really looking forward to presenting on a couple of modules and learning about others, but some things have piled up on me and I won't be able to attend after all. Sorry to have to back out on this. peace, Jason -- Jason Hildebrand PeaceWorks Computer Consulting #2 - 396 Assiniboine Ave, Winnipeg 204 480 0314 --or-- 519 725 7875, ext 620. ----- "Sydney Weidman" wrote: > Just a reminder that the next meeting of the Winnipeg Python Users > Group > is going to be held at room 2M70, University of Winnipeg at 7:30 PM > next > Wednesday (June 27th). > > This meeting's topic is "Batteries Included: A Tour of the Python > Library" and we need your help!! If you'd like to give a short (10 or > 15 > minute) presentation on one or two standard library modules, please > sign > up by editing the Presenter Sign Up page: > > http://wiki.python.org/moin/PresenterSignUp > > or reply to the list with the module you intend to cover. Remember, > it > doesn't have to be fancy, just a basic run-through of the module's > use. > > So far, only Jason Hildebrand and myself have signed up to give > presentations. Come on, pythonistas! There's lots more library to > cover! > > Directions: > > Room 2M70 is on the second floor of the University in Manitoba Hall. > >From the main doors in Centennial Hall, go up the escalator one > floor, > take the first right through the archway into Manitoba Hall, then > turn > left and proceed down the corridor. 2M70 will be on your right about > 1/3 > of the way down the corridor. > > For those of you who would like to navigate via maps, here is the > link > to follow: > > http://www.uwinnipeg.ca/index/maps > > See you there! > > Regards, > Syd Weidman > > _______________________________________________ > Winnipeg mailing list > Winnipeg at python.org > http://mail.python.org/mailman/listinfo/winnipeg From high.res.mike at gmail.com Thu Jun 28 01:05:05 2007 From: high.res.mike at gmail.com (Mike Pfaiffer) Date: Thu, 28 Jun 2007 00:05:05 -0500 Subject: [Python Wpg] Tested seed() Message-ID: <46834181.2000303@gmail.com> Here is some code. #!/usr/bin/python from random import seed, randint seed(2) for c in range(10): print c,randint(1,10) Ran it twice under idle and the same results came out three times. Looks like it is best to run it without a value in seed(). Here is what I got... IDLE 1.2.1 >>> ================================ RESTART ================================ >>> 0 10 1 10 2 1 3 1 4 9 5 8 6 7 7 4 8 7 9 7 >>> Later Mike From rick at centrix.ca Thu Jun 28 01:12:26 2007 From: rick at centrix.ca (Richard Fillion) Date: Thu, 28 Jun 2007 00:12:26 -0500 Subject: [Python Wpg] Tested seed() In-Reply-To: <46834181.2000303@gmail.com> References: <46834181.2000303@gmail.com> Message-ID: <548D93B3-8A7A-4FEC-8361-9962B58FC646@centrix.ca> You shouldn't pass a static value to a random seed generator. Pass something that will change, such as the current time, or date, or ... anything not-constant. Richard Fillion e: rick at centrix.ca p: 204.291.5800 On Jun 28, 2007, at 12:05 AM, Mike Pfaiffer wrote: > Here is some code. > > #!/usr/bin/python > > from random import seed, randint > > seed(2) > for c in range(10): > print c,randint(1,10) > > > Ran it twice under idle and the same results came out three times. > Looks like it is best to run it without a value in seed(). > > Here is what I got... > > IDLE 1.2.1 >>>> ================================ RESTART > ================================ >>>> > 0 10 > 1 10 > 2 1 > 3 1 > 4 9 > 5 8 > 6 7 > 7 4 > 8 7 > 9 7 >>>> > > Later > Mike > > _______________________________________________ > Winnipeg mailing list > Winnipeg at python.org > http://mail.python.org/mailman/listinfo/winnipeg > From high.res.mike at gmail.com Thu Jun 28 05:40:38 2007 From: high.res.mike at gmail.com (Mike Pfaiffer) Date: Thu, 28 Jun 2007 04:40:38 -0500 Subject: [Python Wpg] Tested seed() In-Reply-To: <548D93B3-8A7A-4FEC-8361-9962B58FC646@centrix.ca> References: <46834181.2000303@gmail.com> <548D93B3-8A7A-4FEC-8361-9962B58FC646@centrix.ca> Message-ID: <46838216.3080402@gmail.com> Richard Fillion wrote: > You shouldn't pass a static value to a random seed generator. Pass > something that will change, such as the current time, or date, or ... > anything not-constant. > > Richard Fillion > e: rick at centrix.ca > p: 204.291.5800 We had a discussion about this at the meeting. If you leave out the "2" the seed is based on the system time. I was curious if putting a constant in the seed() function would return the same values each time it's run. Nobody knew for sure. Nobody caught anything in the documentation. Now we know. Historically there are only two random generators I've seen which "self seed". The first is the Apple// (which I discussed at the meeting) and the second is an *old* PC card which got its seed from the amount of static electricity in the air. Later Mike > On Jun 28, 2007, at 12:05 AM, Mike Pfaiffer wrote: > >> Here is some code. >> >> #!/usr/bin/python >> >> from random import seed, randint >> >> seed(2) >> for c in range(10): >> print c,randint(1,10) >> >> >> Ran it twice under idle and the same results came out three times. >> Looks like it is best to run it without a value in seed(). >> >> Here is what I got... >> >> IDLE 1.2.1 >>>>> ================================ RESTART >> ================================ >> 0 10 >> 1 10 >> 2 1 >> 3 1 >> 4 9 >> 5 8 >> 6 7 >> 7 4 >> 8 7 >> 9 7 >> Later >> Mike >> >> _______________________________________________ >> Winnipeg mailing list >> Winnipeg at python.org >> http://mail.python.org/mailman/listinfo/winnipeg >> > > _______________________________________________ > Winnipeg mailing list > Winnipeg at python.org > http://mail.python.org/mailman/listinfo/winnipeg > From sara_arenson at yahoo.ca Thu Jun 28 10:18:00 2007 From: sara_arenson at yahoo.ca (Sara Arenson) Date: Thu, 28 Jun 2007 10:18:00 -0400 (EDT) Subject: [Python Wpg] Tested seed() In-Reply-To: <548D93B3-8A7A-4FEC-8361-9962B58FC646@centrix.ca> Message-ID: <138539.78206.qm@web90509.mail.mud.yahoo.com> If you pass nothing, i.e. just write seed(), it automatically uses system time. Sara --- Richard Fillion wrote: > You shouldn't pass a static value to a random seed generator. Pass > something that will change, such as the current time, or date, or ... > anything not-constant. > > Richard Fillion > e: rick at centrix.ca > p: 204.291.5800 > > > > On Jun 28, 2007, at 12:05 AM, Mike Pfaiffer wrote: > > > Here is some code. > > > > #!/usr/bin/python > > > > from random import seed, randint > > > > seed(2) > > for c in range(10): > > print c,randint(1,10) > > > > > > Ran it twice under idle and the same results came out three times. > > Looks like it is best to run it without a value in seed(). > > > > Here is what I got... > > > > IDLE 1.2.1 > >>>> ================================ RESTART > > ================================ > >>>> > > 0 10 > > 1 10 > > 2 1 > > 3 1 > > 4 9 > > 5 8 > > 6 7 > > 7 4 > > 8 7 > > 9 7 > >>>> > > > > Later > > Mike > > > > _______________________________________________ > > Winnipeg mailing list > > Winnipeg at python.org > > http://mail.python.org/mailman/listinfo/winnipeg > > > > _______________________________________________ > Winnipeg mailing list > Winnipeg at python.org > http://mail.python.org/mailman/listinfo/winnipeg > Get news delivered with the All new Yahoo! Mail. Enjoy RSS feeds right on your Mail page. Start today at http://mrd.mail.yahoo.com/try_beta?.intl=ca From dave at gabrielson.ca Thu Jun 28 10:42:38 2007 From: dave at gabrielson.ca (Dave Gabrielson) Date: Thu, 28 Jun 2007 09:42:38 -0500 Subject: [Python Wpg] Tested seed() In-Reply-To: <138539.78206.qm@web90509.mail.mud.yahoo.com> References: <138539.78206.qm@web90509.mail.mud.yahoo.com> Message-ID: <200706280942.38258.dave@gabrielson.ca> Hmm... in the stock 2.4 python distribution, the random module is source code, which is always fun to look at. :-) It seems that seed() will use os.urandom(), if available, and will fallback to time.time() if that's not around. It also seems like the module bootstraps itself with a class instance, which is how the module does self-seeding... which is almost always what you want (i.e., don't call seed(), it's already been done for you). A reason you may want to call seed is: if you are developing a program that relies on randomly influenced (but still complicated) choices, and you wished to debug the non-random portion of the logic... In my experience, seed( 2 ) and the like will ALWAYS produce the same sequence of pseudo-random numbers, which is useful for testing (sometimes), be it in Pascal, C++ or Python. --Dave . (Currently working on pseudo-random meshing algorithms in python!) On Thursday 28 June 2007 09:18, Sara Arenson wrote: > If you pass nothing, i.e. just write seed(), it automatically uses system > time. > > Sara From jscrerar at compuserve.com Fri Jun 29 14:00:06 2007 From: jscrerar at compuserve.com (Jim Crerar) Date: Fri, 29 Jun 2007 12:00:06 -0600 Subject: [Python Wpg] Tested seed() References: <46834181.2000303@gmail.com> <548D93B3-8A7A-4FEC-8361-9962B58FC646@centrix.ca> <46838216.3080402@gmail.com> Message-ID: <006701c7ba77$537687e0$3f0110ac@JIMandELSIE> Hi, When doing simulations it is important that you use the same seed in order to acurately compare different alternatives. Thanks, Jim Crerar From syd at plug.ca Fri Jun 29 18:12:28 2007 From: syd at plug.ca (Sydney Weidman) Date: Fri, 29 Jun 2007 17:12:28 -0500 Subject: [Python Wpg] Puzzled by traceback and pdb behaviour Message-ID: <1183155149.14463.12.camel@localhost.localdomain> Hi all! I'm wondering if anyone has seen this and has a clue why it happens: I'm debugging some errors in a ZopeTestCase test that I wrote, and in the traceback that occurs (as well as in the interactive debugger), the output lists a directory which was previously deleted, i.e.: File "/home/sweidman/Data/plone-2.5.2-instance/Products/CMFQuickInstallerTool/QuickInstallerTool.py", line 322, in installProduct the directory "plone-2.5.2-instance" was deleted long ago. During interactive debugging using emacs, emacs cannot find some source files because pdb tells emacs to look for the file in the non-existent directory. Does anyone know why this occurs? Should I try removing some relevant *.pyc files? Thanks in advance for any thoughts on this. Have a great Canada Day weekend! - syd