Re: [Tutor] date formatter

2008-08-07 Thread Christopher Spears
Ok, here is the working version of my program. Thanks for all of the advice: #!/usr/bin/python import time class date_format(object): def __init__(self, month, day, year): month_dict = {("jan","january") : 1, ("feb","february") :2,

Re: [Tutor] Ongoing trouble with Turtle's end_fill() - caused by abug in turtle.py

2008-08-07 Thread Dick Moores
On Thu, Aug 7, 2008 at 4:04 PM, Gregor Lingl <[EMAIL PROTECTED]> wrote: > Hi Dick, > > first of all, thanks for your efforts using the new turtle module > and reporting about your experiences and the problems you ran into. Sure. And I'm not finished. There seem to be some interesting new things wo

Re: [Tutor] Ongoing trouble with Turtle's end_fill() - caused by abug in turtle.py

2008-08-07 Thread Dick Moores
On Thu, Aug 7, 2008 at 4:04 PM, Gregor Lingl <[EMAIL PROTECTED]> wrote: > Hi Dick, > > first of all, thanks for your efforts using the new turtle module > and reporting about your experiences and the problems you ran into. Sure. And I'm not finished. There seem to be some interesting new things wo

Re: [Tutor] Ongoing trouble with Turtle's end_fill() - caused by abug in turtle.py

2008-08-07 Thread Gregor Lingl
Hi Dick, first of all, thanks for your efforts using the new turtle module and reporting about your experiences and the problems you ran into. I've already made some remarks on it in a former reply in this thread. On Thu, Aug 7, 2008 at 11:26 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: ... 2.

Re: [Tutor] Ongoing trouble with Turtle's end_fill()

2008-08-07 Thread Gregor Lingl
Alan Gauld schrieb: "Dick Moores" <[EMAIL PROTECTED]> wrote 1. The turtle has some behavior I don't see how to eliminate. If you refer to lines 223, 225, 227, 229, etc., you'll see that the turtle always faces in the direction it is moving when drawing a rectangle. That is correct behaviour f

Re: [Tutor] Ongoing trouble with Turtle's end_fill() - caused by abug in turtle.py

2008-08-07 Thread Dick Moores
On Thu, Aug 7, 2008 at 11:26 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > "Dick Moores" <[EMAIL PROTECTED]> wrote > >> 1. The turtle has some behavior I don't see how to eliminate. If you >> refer to lines 223, 225, 227, 229, etc., you'll see that the turtle >> always faces in the direction it is mo

Re: [Tutor] Split string on 2 delimiters ?

2008-08-07 Thread Kent Johnson
On Thu, Aug 7, 2008 at 5:25 PM, dave selby <[EMAIL PROTECTED]> wrote: > Hi all, > > Is there a neat way to split a string on either of two delimiters ie > space and comma Use re.split(): In [1]: import re In [2]: data = 'tom,dick harry' In [4]: re.split(r'[, ]', data) Out[4]: ['tom', 'dick', 'har

Re: [Tutor] Split string on 2 delimiters ?

2008-08-07 Thread Timothy Grant
On Thu, Aug 7, 2008 at 2:25 PM, dave selby <[EMAIL PROTECTED]> wrote: > Hi all, > > Is there a neat way to split a string on either of two delimiters ie > space and comma > > Cheers > > Dave >>> import re >>> string = 'this is, a test of splitting; on two delimiters' >>> re.split(r'[,;]', string)

[Tutor] Split string on 2 delimiters ?

2008-08-07 Thread dave selby
Hi all, Is there a neat way to split a string on either of two delimiters ie space and comma Cheers Dave -- Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ___ Tutor maillist - Tu

Re: [Tutor] Python and NT Authentication

2008-08-07 Thread Alan Gauld
"Steven L Smith" <[EMAIL PROTECTED]> wrote in We have ActiveState Python 2.5 installed on an IIS box running Windows 2003. We're doing it this way because we will most likely be switching to Apache / Unix in the future, and we don't want to have to rewrite all of our server-side scripts. ..

Re: [Tutor] Ongoing trouble with Turtle's end_fill() - caused by abug in turtle.py

2008-08-07 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote 1. The turtle has some behavior I don't see how to eliminate. If you refer to lines 223, 225, 227, 229, etc., you'll see that the turtle always faces in the direction it is moving when drawing a rectangle. That is correct behaviour for a turtle! Remember

Re: [Tutor] Ongoing trouble with Turtle's end_fill() - caused by a bug in turtle.py

2008-08-07 Thread Dick Moores
On Thu, Aug 7, 2008 at 9:54 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > 4. I've attempted to make the turtle invisible, but haven't succeeded. Got it! hideturtle() Dick ___ Tutor maill

Re: [Tutor] Ongoing trouble with Turtle's end_fill() - caused by a bug in turtle.py

2008-08-07 Thread Dick Moores
On Wed, Aug 6, 2008 at 5:09 PM, Gregor Lingl <[EMAIL PROTECTED]> wrote: > This is due to a bug in turtle.py - interestingly after so many years of use > and improvement of turtle.py there still appear new bugs from time to time. > > The bug consists in a missing update of the Canvas in the fill() f

Re: [Tutor] Python and NT Authentication

2008-08-07 Thread Chris Fuller
You should search/browse MSDN for authentication info. Also, you can run Apache on windows, if that eases your migration. http://msdn.microsoft.com/en-us/library/aa374735(VS.85).aspx This probably what you want. Just be sure to keep your authentication code as modular as possible, if you are

[Tutor] Fwd: Python and NT Authentication

2008-08-07 Thread W W
(I hate it when I forget to "reply-to all") -- Forwarded message -- From: W W <[EMAIL PROTECTED]> Date: Thu, Aug 7, 2008 at 11:30 AM Subject: Re: [Tutor] Python and NT Authentication To: Steven L Smith <[EMAIL PROTECTED]> On Thu, Aug 7, 2008 at 9:55 AM, Steven L Smith <[EMAIL PRO

[Tutor] Python and NT Authentication

2008-08-07 Thread Steven L Smith
Hello, everyone- I'm trying to both learn Python and develop a fairly robust web form with it at the same time... nothing like being thrown into a new job and having to learn a new language to do it! We have ActiveState Python 2.5 installed on an IIS box running Windows 2003. We're doing it th

Re: [Tutor] Python and the Global Interpreter Lock

2008-08-07 Thread bob gailer
OkaMthembo wrote: Hi there, I just came across something called the Global Interpreter Lock, and apparently its a condition where an interpreter locks resources to avoid sharing them with other apps/ processes on the system? I wish to find out what this means in terms of Python. for example do

Re: [Tutor] Merging dictionaries

2008-08-07 Thread Lie Ryan
> Message: 4 > Date: Wed, 6 Aug 2008 21:59:40 +0200 > From: "Norman Khine" <[EMAIL PROTECTED]> > Subject: [Tutor] Merging dictionaries > To: tutor@python.org > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1 > > Hello, > I am trying to figure out the best w

[Tutor] Python and the Global Interpreter Lock

2008-08-07 Thread OkaMthembo
Hi there, I just came across something called the Global Interpreter Lock, and apparently its a condition where an interpreter locks resources to avoid sharing them with other apps/ processes on the system? I wish to find out what this means in terms of Python. for example does it mean that Python

Re: [Tutor] iterating data and populating a dictionary

2008-08-07 Thread W W
On Thu, Aug 7, 2008 at 12:42 AM, Shrutarshi Basu <[EMAIL PROTECTED]>wrote: > If you're just going to be using numbers as dictionary keys, it might > be simpler just to use a list structure. Dictionaries don't preserve > order, so you'd need to write extra code if you ever need to iterate > over it

Re: [Tutor] Merging dictionaries

2008-08-07 Thread Norman Khine
Thank you all for the replies. Norman On 8/7/08, wesley chun <[EMAIL PROTECTED]> wrote: > hmmm, somewhat off-topic, i was partially confused by the Subject > line. i thought this post was about merging *dictionaries* and not > merging the *contents of multiple dictionaries' values*. > > for those

Re: [Tutor] date formatter

2008-08-07 Thread Benoit Thiell
On Thu, 7 Aug 2008, bob gailer wrote: Christopher Spears wrote: Hey, I'm working on a problem out of Core Python Programming (2nd Edition). Basically, I'm creating a class that formats dates. Here is what I have so far: Consider reformatting the month_dict so each name and abbreviatio

Re: [Tutor] date formatter

2008-08-07 Thread bob gailer
Christopher Spears wrote: Hey, I'm working on a problem out of Core Python Programming (2nd Edition). Basically, I'm creating a class that formats dates. Here is what I have so far: Consider reformatting the month_dict so each name and abbreviation is a key. Then you can just look up th