Re: [Tutor] Tutorial indicating different output

2008-05-08 Thread Mark Tolonen
"Eric Morey" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello everyone, I have no prior experience with programing. I've just started with the Python tutorial at http://www.dickbaldwin.com/tocpyth.htm. On the section that describes decimal division on this page: http://www.d

Re: [Tutor] animations and movies

2008-05-08 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote hey just wondering if any one can point me in the right direction for coding animations and playing movies ISTR a tool called blender that could do this. It was scripted in Python. Alan G ___ Tutor maillist - Tutor

Re: [Tutor] regex newbie question

2008-05-08 Thread Steve Willoughby
Dick Moores wrote: At 04:32 PM 5/8/2008, Steve Willoughby wrote: On Thu, May 8, 2008 14:40, Dick Moores wrote: > At 01:30 PM 5/8/2008, Steve Willoughby wrote: >>On Thu, May 8, 2008 12:40, Dick Moores wrote: >> > But here's a chance to ask: What regex would match 2-digit strings >> > and 4-digit

[Tutor] animations and movies

2008-05-08 Thread Nick.Treloar
hey just wondering if any one can point me in the right direction for coding animations and playing movies This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended re

Re: [Tutor] regex newbie question

2008-05-08 Thread Dick Moores
At 04:32 PM 5/8/2008, Steve Willoughby wrote: On Thu, May 8, 2008 14:40, Dick Moores wrote: > At 01:30 PM 5/8/2008, Steve Willoughby wrote: >>On Thu, May 8, 2008 12:40, Dick Moores wrote: >> > But here's a chance to ask: What regex would match 2-digit strings >> > and 4-digit strings only? >> >>^

[Tutor] How to catch this exception?

2008-05-08 Thread Dick Moores
< http://py77.python.pastebin.com/f7191854a> is my addDaysToDate.py . As an exercise I'm trying to handle every kind of exception that can result from user entry. One I can't figure out is this. The program asks for a date, then a number of days or weeks. A new date is calculated--the date enter

Re: [Tutor] regex newbie question

2008-05-08 Thread Steve Willoughby
On Thu, May 8, 2008 16:32, Steve Willoughby wrote: > On Thu, May 8, 2008 14:40, Dick Moores wrote: >> At 01:30 PM 5/8/2008, Steve Willoughby wrote: >>>On Thu, May 8, 2008 12:40, Dick Moores wrote: >>> > But here's a chance to ask: What regex would match 2-digit strings >>> > and 4-digit strings onl

Re: [Tutor] regex newbie question

2008-05-08 Thread Steve Willoughby
On Thu, May 8, 2008 14:40, Dick Moores wrote: > At 01:30 PM 5/8/2008, Steve Willoughby wrote: >>On Thu, May 8, 2008 12:40, Dick Moores wrote: >> > But here's a chance to ask: What regex would match 2-digit strings >> > and 4-digit strings only? >> >>^\d\d(\d\d)?$ > > Ah. And so ^\d\d(\d\d)?(\d\d)?$

Re: [Tutor] Tutorial indicating different output

2008-05-08 Thread Alan Gauld
"Eric Morey" <[EMAIL PROTECTED]> wrote >>> 2.0/5 # get decimal quotient 0.4 >>> 2/5.0 # do it again 0.4 >>>  http://www.dickbaldwin.com/python/Pyth0004-fig10.htm Howerver, using the python shell in my terminal, I get: >>> 2.0/5 # get decimal quotien

Re: [Tutor] regex newbie question

2008-05-08 Thread Dick Moores
At 01:30 PM 5/8/2008, Steve Willoughby wrote: On Thu, May 8, 2008 12:40, Dick Moores wrote: > But here's a chance to ask: What regex would match 2-digit strings > and 4-digit strings only? ^\d\d(\d\d)?$ Ah. And so ^\d\d(\d\d)?(\d\d)?$ matches all and only 2-, 4-, and 6-digit strings. Which m

[Tutor] Tutorial indicating different output

2008-05-08 Thread Eric Morey
Hello everyone, I have no prior experience with programing. I've just started with the Python tutorial at http://www.dickbaldwin.com/tocpyth.htm. On the section that describes decimal division on this page: http://www.dickbaldwin.com/python/Pyth0004.htm Figure 10 shows: >>> 2.0/5 # ge

Re: [Tutor] regex newbie question

2008-05-08 Thread Steve Willoughby
On Thu, May 8, 2008 12:40, Dick Moores wrote: > At 11:46 AM 5/8/2008, Steve Willoughby wrote: >>Be aware that \d{2,4} matches 2, 3 or 4 digits, which may be >>different than what you're looking for, since 1/12/234 would >>match > > Yes, I wanted to permit that. In my script, mxDateTime turns 1/12/2

Re: [Tutor] converting all files in a directory with subprocess

2008-05-08 Thread Tim Golden
Tim Michelsen wrote: Hello, I am working on a automatic documentation program to convert my txt2tags based documentations sources into HTMl files. I want to use txt2tags via command line. Here's my code: # #!/usr/bin/env python # -*- coding: utf-8 -*- import os import subprocess import

[Tutor] converting all files in a directory with subprocess

2008-05-08 Thread Tim Michelsen
Hello, I am working on a automatic documentation program to convert my txt2tags based documentations sources into HTMl files. I want to use txt2tags via command line. Here's my code: # #!/usr/bin/env python # -*- coding: utf-8 -*- import os import subprocess import fnmatch documentation

Re: [Tutor] regex newbie question

2008-05-08 Thread Dick Moores
At 11:46 AM 5/8/2008, Steve Willoughby wrote: Be aware that \d{2,4} matches 2, 3 or 4 digits, which may be different than what you're looking for, since 1/12/234 would match Yes, I wanted to permit that. In my script, mxDateTime turns 1/12/234 into 01/12/0234. So if a user wants to enter it, I

Re: [Tutor] regex newbie question

2008-05-08 Thread Steve Willoughby
Be aware that \d{2,4} matches 2, 3 or 4 digits, which may be different than what you're looking for, since 1/12/234 would match On Thu, May 8, 2008 11:42, Dick Moores wrote: > > > At 11:14 AM 5/8/2008, Kent Johnson wrote: > On Thu, May 8, 2008 at 1:51 PM, > Dick Moores <[EMAIL PROTECTED]> wrote:

Re: [Tutor] regex newbie question

2008-05-08 Thread Dick Moores
At 11:14 AM 5/8/2008, Kent Johnson wrote: On Thu, May 8, 2008 at 1:51 PM, Dick Moores <[EMAIL PROTECTED]> wrote: > >  Could someone tell me what's wrong with this regex? > >  == >  lst = ["2/2/2", "3/3/45", "345/03/45", "4/4/2009", "4/4/12345", >   

Re: [Tutor] regex newbie question

2008-05-08 Thread Steve Willoughby
On Thu, May 8, 2008 10:51, Dick Moores wrote: > > > Could someone tell me what's wrong with this regex? The main thing is that you're forgetting that a RE matches anywhere in the string. \b\d+/\d+/\d{2,4}\b matches 4/4/2009 12/12/555 \b\d{1,2}/\d{1,2}\b matches 4/4/2009 4/4/12345 12/12/555 1

Re: [Tutor] regex newbie question

2008-05-08 Thread Kent Johnson
On Thu, May 8, 2008 at 1:51 PM, Dick Moores <[EMAIL PROTECTED]> wrote: > > Could someone tell me what's wrong with this regex? > > == > lst = ["2/2/2", "3/3/45", "345/03/45", "4/4/2009", "4/4/12345", > "12/12/555", "12/12", "2/2", "2/12", "12/2

Re: [Tutor] Buffering in file.read()

2008-05-08 Thread Kent Johnson
On Thu, May 8, 2008 at 1:40 PM, Dave Kuhlman <[EMAIL PROTECTED]> wrote: > On Thu, May 08, 2008 at 09:10:29PM +0530, Sandip Bhattacharya wrote: > Take a look at the optional "bufsize" argument to the "open" built-in > function: > > "The optional bufsize argument specifies the file's desired bu

[Tutor] regex newbie question

2008-05-08 Thread Dick Moores
Could someone tell me what's wrong with this regex? == lst = ["2/2/2", "3/3/45", "345/03/45", "4/4/2009", "4/4/12345",    "12/12/555", "12/12", "2/2", "2/12", "12/2"] regex = r"\b\d+/\d+/\d{2,4}\b|\b\d{1,2}/\d{1,2}\b" lst2 = [] for date in lst:    

Re: [Tutor] Buffering in file.read()

2008-05-08 Thread Dave Kuhlman
On Thu, May 08, 2008 at 09:10:29PM +0530, Sandip Bhattacharya wrote: > > Suppose I need to > write a program which needs to parse lots of binary files. This requires > multiple reads of small amounts of data. Obviously if I need to do this > very often, I need to do some kind of buffering to redu

[Tutor] Buffering in file.read()

2008-05-08 Thread Sandip Bhattacharya
Suppose I need to write a program which needs to parse lots of binary files. This requires multiple reads of small amounts of data. Obviously if I need to do this very often, I need to do some kind of buffering to reduce IO. My question is this - does Python have its own buffering while doing f

Re: [Tutor] Memory Leak?

2008-05-08 Thread Michael Langford
> > >>You can always make a subclass of the classes you're thinking aren't > being > >>garbage collected and put a print statement in their __del__ functions to > >>show you when they are. That will show you if/which objects aren't being > >>deleted. > > Is this reliable or will this just confuse t

Re: [Tutor] Memory Leak?

2008-05-08 Thread Eike Welk
On Thursday 08 May 2008 00:03, Keith Suda-Cederquist wrote: > So I started commenting things out until I isolated the problem. > For some reason when I plot some of the data using > pylab/matplotlib, then close the figure using pylab.close() the > memory doesn't get cleared. (I left this part out