[Tutor] Regular Expressions: escaping in character classes/character sets

2008-07-06 Thread Josh Rosen
I was browsing through the source code of Django when I found the following regular expression: tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') As it turns out, this line from the message module in the Python standard library's email module. It seems to be used to determine if an ema

Re: [Tutor] graphs & diagrams in python

2008-07-06 Thread Kent Johnson
On Sat, Jul 5, 2008 at 9:16 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Fri, Jul 4, 2008 at 3:54 PM, Monika Jisswel > <[EMAIL PROTECTED]> wrote: >> Hi Again, >> >> What is the best library for drawing graphs & diagrams to ilustrate some >> statistics ? > > A few possibilities here: > http://wi

Re: [Tutor] file object in memory

2008-07-06 Thread Martin Walsh
Monika Jisswel wrote: > You know bob, you are very clever, I have used RAM disk for realtime > recording of audio before but it never occured to me to use it for light > jobs like this one, I just compeletely ignored it as an option & by the > way this openes a lot of doors for many of my other pro

Re: [Tutor] assert() question

2008-07-06 Thread Dick Moores
At 02:30 PM 7/6/2008, Kent Johnson wrote: On Sun, Jul 6, 2008 at 2:49 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > I have a module, mycalc.py, which is a collection of functions designed to > be imported independently. > > I've heard about using assert() to check up on whether things are still >

Re: [Tutor] assert() question

2008-07-06 Thread Kent Johnson
On Sun, Jul 6, 2008 at 2:49 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > I have a module, mycalc.py, which is a collection of functions designed to > be imported independently. > > I've heard about using assert() to check up on whether things are still > working correctly, or something like that. S

Re: [Tutor] search path

2008-07-06 Thread bob gailer
Robert Johansson wrote: I have some functions written in Matlab which I want to translate into Python so that my friends (how don’t have Matlab) can enjoy them. My program does some work on a bunch of textfiles which I have put in the same directory as the Python-scriptfile with the function

[Tutor] search path

2008-07-06 Thread Robert Johansson
I have some functions written in Matlab which I want to translate into Python so that my friends (how don't have Matlab) can enjoy them. My program does some work on a bunch of textfiles which I have put in the same directory as the Python-scriptfile with the function definitions. Things run pretty

Re: [Tutor] Tutor Digest, Vol 53, Issue 18

2008-07-06 Thread Tony Cappellini
Message: 7 Date: Sat, 05 Jul 2008 12:23:36 -0600 From: Nathan Farrar <[EMAIL PROTECTED]> Subject: [Tutor] Exploring the Standard Library To: Python Tutor Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" >>I'd like to spend some time exploring the standard library. This

Re: [Tutor] unsiscribe

2008-07-06 Thread bob gailer
james collins wrote: how do i unsiscribe from the mailing list? Follow the link below -- Bob Gailer 919-636-4239 Chapel Hill, NC ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] unsiscribe

2008-07-06 Thread james collins
how do i unsiscribe from the mailing list? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Exploring the Standard Library

2008-07-06 Thread bhaaluu
On Sat, Jul 5, 2008 at 2:23 PM, Nathan Farrar <[EMAIL PROTECTED]> wrote: > I'd like to spend some time exploring the standard library. I'm running > python on Ubuntu. How would I find the location of the modules (find / > -name "os.py" does not yield results)? > > Thanks! > Nathan > _

Re: [Tutor] Wave module

2008-07-06 Thread Tony Cappellini
Message: 1 Date: Sat, 5 Jul 2008 16:50:35 -0600 From: "Alex Krycek" <[EMAIL PROTECTED]> Subject: [Tutor] Wave module To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Hello, I'm trying to join two .wav files with the wave module. But when I

Re: [Tutor] assert() question

2008-07-06 Thread Dick Moores
At 06:01 AM 7/6/2008, Alan Gauld wrote: "Dick Moores" <[EMAIL PROTECTED]> wrote Traceback (most recent call last): File "E:\PythonWork\Untitled 2.py", line 42, in assert(fact(10,4) == 3.629e+6) AssertionError I'm not sure but I suspect you are running into the dreaded floating point pre

Re: [Tutor] module paths

2008-07-06 Thread Kent Johnson
On Sat, Jul 5, 2008 at 6:37 PM, Gonzalo Garcia-Perate <[EMAIL PROTECTED]> wrote: > I'm looking at python after a long time. I wanted to build a quick > parser for some rss feeds and have started using feedparser. > > When I test my code on the python interactive shell things work fine > but when I

Re: [Tutor] assert() question

2008-07-06 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote Traceback (most recent call last): File "E:\PythonWork\Untitled 2.py", line 42, in assert(fact(10,4) == 3.629e+6) AssertionError I'm not sure but I suspect you are running into the dreaded floating point precision problem. You probably need to

Re: [Tutor] my first object model, using an interface

2008-07-06 Thread Alan Gauld
"Monika Jisswel" <[EMAIL PROTECTED]> wrote This looks like a database driven application. I agree the final app will need to use a database for persistence. However the OP was specifically looking to use OOP principles so simply encapsulating the database is probably not the best approach for

Re: [Tutor] my first object model, using an interface

2008-07-06 Thread Monika Jisswel
This looks like a database driven application. When you send a package you must save the event on a database. When a HomeWork is submited it must be entered in the database. When you need to see what's the situation of any one student or all students you just query teh database. so you would be bet

Re: [Tutor] assert() question

2008-07-06 Thread Dick Moores
At 01:23 AM 7/6/2008, Alan Gauld wrote: "Dick Moores" <[EMAIL PROTECTED]> wrote I've heard about using assert() to check up The top three work silently, but I found that I could not figure out how to use assert() with the functions that print rather than return. E.g., maxDiffBetPrimes() and prin

Re: [Tutor] directory traversal help

2008-07-06 Thread Michael
Further to this query I actually hit the manuals and found that their already was a walk function. My final solution was thus... Please note it is heavily commented because I am a teacher and created this for a student :-) # Will create a listing in a file called dirlist.txt of all the files in

Re: [Tutor] assert() question

2008-07-06 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote I've heard about using assert() to check up The top three work silently, but I found that I could not figure out how to use assert() with the functions that print rather than return. E.g., maxDiffBetPrimes() and printTime(). Is there a way? Thats an

Re: [Tutor] my first object model, using an interface

2008-07-06 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote adequately, after reading Alan Gauld's excellent tutorial Thanks for the mention, glad you found it useful. - a Watchable interface that, when implemented, signifies that the implementing object has a threshold and associated package. - a Package class, that can be

Re: [Tutor] module paths

2008-07-06 Thread Gonzalo Garcia-Perate
ok I fixed it. I removed 2.4 and re-linked /usr/local/bin/python to /Library/Frameworks/Python.framework/Versions/Current/bin/python thanks! 2008/7/6 Gonzalo Garcia-Perate <[EMAIL PROTECTED]>: > That's what I thought but no. There is an install of 2.4 but not in > use. /usr/local/bin/Python point