Re: [Tutor] apihelper module for python

2007-04-02 Thread Kent Johnson
Brian McDermott wrote: > i have looked and been unable to find this module anywhere, can somebody > please direct me to where i can download it, thanks A little context might help here, but I guess you are looking for the apihelper referenced in Chapter 4 of Dive Into Python. This module is inc

[Tutor] apihelper module for python

2007-04-02 Thread Brian McDermott
i have looked and been unable to find this module anywhere, can somebody please direct me to where i can download it, thanks _ Message offline contacts without any fire risk! http://www.communicationevolved.com/en-ie/ _

Re: [Tutor] hashlib weirdness

2007-04-02 Thread Terry Carroll
On 2 Apr 2007, Greg Perry wrote: > Thanks Terry, others have pointed out the same thing. The stock Python > 2.5 interpreter functions properly; my issue seems to be with the IDE I > am using, that is where I've been able to nail down the problem so far. Just curious, what's the IDE? __

Re: [Tutor] datetime.timedelta Output Format

2007-04-02 Thread William Allison
Kent Johnson wrote: > > It looks like Gustavo Niemeyer's dateutil module will at least do the > year/month/day calculation if not the formatting: > > In [1]: from datetime import date > In [2]: from dateutil import relativedelta > In [3]: now = date.today() > In [9]: rd = relativedelta.relativedel

Re: [Tutor] hashlib weirdness

2007-04-02 Thread Greg Perry
Thanks Terry, others have pointed out the same thing. The stock Python 2.5 interpreter functions properly; my issue seems to be with the IDE I am using, that is where I've been able to nail down the problem so far. -Original Message- From: Terry Carroll On 30 Mar 2007, Greg Perry wrote

Re: [Tutor] hashlib weirdness

2007-04-02 Thread Terry Carroll
On 30 Mar 2007, Greg Perry wrote: > Here's one that has me stumped. > > I am writing a forensic analysis tool that takes either a file or a > directory as input, then calculates a hash digest based on the contents > of each file. > > I have created an instance of the hashlib class: > > m = hash

Re: [Tutor] Fw: 2) 'WHICH MULTI'

2007-04-02 Thread Terry Carroll
On Fri, 30 Mar 2007, ALAN GAULD wrote: > One of my tutorial users has come upon a really weird bug. > > He has sent a transcript oif his session. Notice that wx > is not defined yet doing help(wx) produces a strange message. Very weird. Here's what I get, weird in a different way... _

[Tutor] C coded extinsion question

2007-04-02 Thread Hughes, Chad O
I am writing a c type extension for Python deriving from the list class (using PyList_Type.tp_init). I have the need to overload the “+” operator (To add two numbers stored as binary lists – instead of concatenation). I have tried the following: static PyMethodDef BinaryList_methods[] = {

Re: [Tutor] A string-manipulation question

2007-04-02 Thread HouseScript
>>The only "hitch" I see is how one tells that an initial >>consonant is a vowel sound or not. (honor vs home)? The above is exactly what I was thinking about, theres no way I could think of besides creating a dict for the few thousand English words that have this trait. Then run a search agai

Re: [Tutor] A bug or a feature - complex arguments in special

2007-04-02 Thread Eike Welk
On Monday 02 April 2007 11:33, Eli Brosh wrote: > from scipy import * > >>> > >>> x=.5 > >>> special.jv(0,x) > > 0.938469807241 > > >>> y=.5+1.j > >>> y > > (0.5+1j) > > >>> special.jv(0,y) > >>> RESTART > >>> > > The results are

Re: [Tutor] Tokenizing a imple string with split()

2007-04-02 Thread Andreas Kostyrka
Alternativly, one might consider the standard shlex module. Depending what one ones to achieve this might be the better or worse choice. Andreas ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tokenizing a imple string with split()

2007-04-02 Thread Jean Mark Gawron
The split method in the "re" module does what you want here. This is a method on compiled re_patterns, so first you construct a regular expression that matches any of the desired separators: >>> s = "spam;egg mail" >>> x_re = re.compile(r'[; ]') >>> s.split("; ") ['spam;egg ma

Re: [Tutor] datetime.timedelta Output Format

2007-04-02 Thread Kent Johnson
William Allison wrote: > Is there a way to have the output of "print tis" in the same format as > "print now" and "print tafmsd" in the code below? > Thanks, > Will > > > savage:~ wallison$ python > Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on

[Tutor] A bug or a feature - complex arguments in special

2007-04-02 Thread Eli Brosh
Alan G wrote: >It would be good if you could include the error text. >However, did you try putting the complex number in parens? >or assigning to a variable and then pass the variable into the call? Well, the error message is not from Pytho but from the operating system (windows XP). It says "py

Re: [Tutor] datetime.timedelta Output Format

2007-04-02 Thread William Allison
Alan Gauld wrote: > "R. Alan Monroe" <[EMAIL PROTECTED]> wrote > > >>> Is there a way to have the output of "print tis" in the same format >>> as >>> "print now" and "print tafmsd" in the code below? >>> > > >>> >>> now = datetime.date.today() >>> >>> print now >>> 2007-04-01 >>> >

Re: [Tutor] datetime.timedelta Output Format

2007-04-02 Thread Alan Gauld
"R. Alan Monroe" <[EMAIL PROTECTED]> wrote >> Is there a way to have the output of "print tis" in the same format >> as >> "print now" and "print tafmsd" in the code below? >> >>> now = datetime.date.today() >> >>> print now >> 2007-04-01 >> >>> tis = now - tafmsd >> >>> print tis >> 4785 d

Re: [Tutor] Communication between classes

2007-04-02 Thread Andrei
Greg Perry liveammo.com> writes: > Is it safe to say that classes are only useful for instances where reuse is a key consideration? From my very > limited perspective, it seems that classes are in most cases overkill for simple tasks (such as reading > the command line then calculating a hash/ch