Re: [Tutor] parse text file

2010-02-03 Thread spir
On Tue, 2 Feb 2010 22:56:22 +0100 Norman Khine wrote: > i am no expert, but there seems to be a bigger difference. > > with repr(), i get: > Sat\\xe9re Maw\\xe9 > > where as you get > > Sat\xc3\xa9re Maw\xc3\xa9 > > repr()'s > é == \\xe9 > whereas on your version > é == \xc3\xa9 This is a ra

Re: [Tutor] parse text file

2010-02-03 Thread Norman Khine
On Tue, Feb 2, 2010 at 11:36 PM, Kent Johnson wrote: > On Tue, Feb 2, 2010 at 4:56 PM, Norman Khine wrote: >> On Tue, Feb 2, 2010 at 10:11 PM, Kent Johnson wrote: > >>> Try this version: >>> >>> data = file.read() >>> >>> get_records = re.compile(r"""openInfoWindowHtml\(.*?\ticon: >>> myIcon\n""

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-03 Thread David
Bob, brilliant stuff -- I am truly awed by this. Create a default-filled matrix and mark combinations used so as to take them out of the game? Wow. This is new to me. On 03/02/10 15:46, bob gailer wrote def askQuestions(): # generate and ask questions: for i in range(NQ): while 1: # loop ti

Re: [Tutor] help with random.randint

2010-02-03 Thread Hugo Arts
On Wed, Feb 3, 2010 at 8:19 AM, David wrote: > Hello Bob, > > thanks for your comments! > > > On 03/02/10 14:51, bob gailer wrote: > >> or if you seek terseness: >> >> terms = [random.randint(1, 99) for i in 'ab'] > > Do I understand correctly that 'ab' here merely serves to produce a 'dummy > seq

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-03 Thread Hugo Arts
On Wed, Feb 3, 2010 at 10:06 AM, David wrote: > Bob, > > brilliant stuff -- I am truly awed by this. Create a default-filled matrix > and mark combinations used so as to take them out of the game? Wow. This is > new to me. > > On 03/02/10 15:46, bob gailer wrote > >> def askQuestions(): # generate

Re: [Tutor] help with random.randint

2010-02-03 Thread spir
On Wed, 03 Feb 2010 11:21:56 +0800 David wrote: > Hello list, > > I thought this was easy even for me, but I was wrong, I guess. > Here is what I want to do: take two random numbers between 1 and 99, and > put them into a list. > > import random > terms = [] > for i in range(2): > terms

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-03 Thread spir
On Wed, 03 Feb 2010 14:12:42 +0800 David wrote: > Hello Benno, list, > > thanks for those clarifications, which, well, clarify things ;-) > > This is my latest creation: > > import random > > def createTerms(): > terms = [] > for i in range(2): > terms.append(random.randin

Re: [Tutor] help with random.randint

2010-02-03 Thread Eike Welk
Hello David! On Wednesday February 3 2010 04:21:56 David wrote: > > import random > terms = [] > for i in range(2): > terms = random.randint(1, 99) > print terms Here is an other solution, which is quite easy to understand and short: import random terms = [] for i in range(2): terms

Re: [Tutor] help with random.randint

2010-02-03 Thread David
Hello Eike, thanks for the explanation, all this is really helpful -- I certainly have learned sth. today! I wonder, though, how I would get my number pairs, which I need later on, if I were to follow your solution. I am asking because as I understand your code, the list terms is a list of int

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-03 Thread Wayne Werner
On Wed, Feb 3, 2010 at 12:12 AM, David wrote: > def createQuestions: >generate all multiplication combinations possible >append as tuple to pool >eliminate 'mirrored doubles' (i.e. 7x12 and 12x7) >randomize pool > > I haven't really looked through most of this stuff - but your mir

Re: [Tutor] help with random.randint

2010-02-03 Thread Wayne Werner
On Wed, Feb 3, 2010 at 5:26 AM, David wrote: > Hello Eike, > > thanks for the explanation, all this is really helpful -- I certainly have > learned sth. today! > I wonder, though, how I would get my number pairs, which I need later on, > if I were to follow your solution. I am asking because as I

[Tutor] help with strings

2010-02-03 Thread NISA BALAKRISHNAN
hi I am very new to python. I have a string for example : 123B new Project i want to separate 123B as a single string and new project as another string . how can i do that. i tried using partition but couldnt do it pls help. thanks in advance! ___

Re: [Tutor] help with strings

2010-02-03 Thread vince spicer
On Wed, Feb 3, 2010 at 7:19 AM, NISA BALAKRISHNAN < snisa.balakrish...@gmail.com> wrote: > hi > > I am very new to python. > I have a string for example : 123B new Project > i want to separate 123B as a single string and new project as another > string . > how can i do that. > i tried using p

Re: [Tutor] help with strings

2010-02-03 Thread Darren Worrall
On 03/02/10 13:19, NISA BALAKRISHNAN wrote: hi I am very new to python. I have a string for example : 123B new Project i want to separate 123B as a single string and new project as another string . how can i do that. i tried using partition but couldnt do it pls help. thanks in advance!

Re: [Tutor] help with strings

2010-02-03 Thread Kent Johnson
On Wed, Feb 3, 2010 at 8:19 AM, NISA BALAKRISHNAN wrote: > hi > > I am very new to python. > I have a string for example : 123B     new Project > i want to separate 123B as a single string and new  project as another > string . > how can i do that. > i tried using partition but couldnt do it str.

Re: [Tutor] help with random.randint

2010-02-03 Thread Eike Welk
On Wednesday February 3 2010 12:26:43 David wrote: > thanks for the explanation, all this is really helpful -- I certainly > have learned sth. today! > I wonder, though, how I would get my number pairs, which I need later > on, if I were to follow your solution. I am asking because as I > understan