Re: [Tutor] Tracking time

2010-01-06 Thread lisaniel
are you going to track the time of the employees or to track the work flow of yours.. it will be quite easier if you specify your query a clear one. Michael Key wrote: > > I am trying to develop a project tracking program that would allow you to > track hours and minutes spent on several differ

Re: [Tutor] need help with 3.1's fraction module

2010-01-06 Thread Richard D. Moores
On Wed, Jan 6, 2010 at 11:59, bob gailer wrote: > Fraction(str(random())).limit_denominator(100) Thanks! So here's what I wanted to do, or its beginning: == from fractions import Fraction from random import random r = random() print(r) f = str(Fraction(str(r)).limit_denomi

Re: [Tutor] need help with 3.1's fraction module

2010-01-06 Thread bob gailer
Richard D. Moores wrote: from fractions import Fraction Fraction('.83452345').limit_denominator(100) Fraction(81, 97) I'd like to know how to do that in a script, where numbers like .83452345 are the output of random.random(). Fraction(random()).limit_denominator(100) Do

[Tutor] need help with 3.1's fraction module

2010-01-06 Thread Richard D. Moores
>>> from fractions import Fraction >>> Fraction('.83452345').limit_denominator(100) Fraction(81, 97) I'd like to know how to do that in a script, where numbers like .83452345 are the output of random.random(). >>> Fraction(random()).limit_denominator(100) Doesn't work, nor did I really expect it

Re: [Tutor] list.insert()

2010-01-06 Thread Alan Gauld
"spir" wrote s = [1,2,3,4,5,6,7,8,9] print s, s[-3], s[-4] # [1, 2, 3, 4, 5, 6, 7, 8, 9] 7 6 s.insert(-3, 0) print s, s[-3], s[-4] # [1, 2, 3, 4, 5, 6, 0, 7, 8, 9] 7 0 So, I did insert 0 at index -3, but s[-3] is still 7, & 0 is in fact at index -4. Seems reasonable. insert() inserts befor

Re: [Tutor] list.insert()

2010-01-06 Thread Wayne Werner
On Wed, Jan 6, 2010 at 8:54 AM, spir wrote: > Hello, > > Just found something rather misleading with negative indices: > > s = [1,2,3,4,5,6,7,8,9] > print s, s[-3], s[-4] # [1, 2, 3, 4, 5, 6, 7, 8, 9] 7 6 > s.insert(-3, 0) > print s, s[-3], s[-4] # [1, 2, 3, 4, 5, 6, 0, 7, 8, 9] 7 0 > > So, I

[Tutor] list.insert()

2010-01-06 Thread spir
Hello, Just found something rather misleading with negative indices: s = [1,2,3,4,5,6,7,8,9] print s, s[-3], s[-4] # [1, 2, 3, 4, 5, 6, 7, 8, 9] 7 6 s.insert(-3, 0) print s, s[-3], s[-4] # [1, 2, 3, 4, 5, 6, 0, 7, 8, 9] 7 0 So, I did insert 0 at index -3, but s[-3] is still 7, & 0 is in fact

Re: [Tutor] Example of use of (?P) and (?P=name) in Python regular expressions?

2010-01-06 Thread Michael Fourman
I've used (?P=name) recently in an implementation of the porter2 stemming algorithm from http://snowball.tartarus.org/algorithms/english/stemmer.html This includes the rule: ## if the word ends with a double remove the last letter (so hopp -> hop) where we ## Define a double as one of ## bb dd