Re: [Tutor] Wiget

2006-06-29 Thread John Fouhy
On 30/06/06, ryan luna <[EMAIL PROTECTED]> wrote: > def number_anwser(self): > guess = self.guess_ent.get() > guess = int(guess) > response = "" > tries = 1 > > if (guess < the_number): > response += "Higher" > tries += 1 >

[Tutor] Wiget

2006-06-29 Thread ryan luna
Hey everyone, im just learning to use Tkinter, and im trynig to write a"Guess my number" game program in widget forum but im having some problems,First heres the code im using,Button(self,   text = "Sumit",   command = self.number_anwser  ).grid(row = 4, column =

Re: [Tutor] Variables don't change when altered within a loop?

2006-06-29 Thread Bob Gailer
Evan Klitzke wrote: > Hi, I just started picking up python yesterday, and have already come > across something that has me stumped. I want some code that does > this: > > a = foo(a) > b = foo(b) > c = foo(c) > > So I try to do this with a for loop, like so: > > for i in [a, b, c]: >i = foo(i)

Re: [Tutor] Variables don't change when altered within a loop?

2006-06-29 Thread Bob Gailer
Evan Klitzke wrote: > Hi, I just started picking up python yesterday, and have already come > across something that has me stumped. I want some code that does > this: > > a = foo(a) > b = foo(b) > c = foo(c) > > So I try to do this with a for loop, like so: > > for i in [a, b, c]: >i = foo(i)

[Tutor] Variables don't change when altered within a loop?

2006-06-29 Thread Evan Klitzke
Hi, I just started picking up python yesterday, and have already come across something that has me stumped. I want some code that does this: a = foo(a) b = foo(b) c = foo(c) So I try to do this with a for loop, like so: for i in [a, b, c]: i = foo(i) print i # make sure that it worked

Re: [Tutor] classes and functions

2006-06-29 Thread Alan Gauld
> how to use classes and functions in python > thanks Most of the online tutorials, including mine, will have a section on OOP. Try reading one and if you have specific questions come back here and we will try to answer them. Alan Gauld Author of the Learn to Program web site http://www.freene

Re: [Tutor] Splitting text

2006-06-29 Thread Terry Carroll
On Thu, 29 Jun 2006, Apparao Anakapalli wrote: > pattern = 'ATTTA' > > I want to find the pattern in the sequence and count. > > For instance in 'a' there are two 'ATTTA's. use re.findall: >>> import re >>> pat = "ATTTA" >>> rexp=re.compile(pat) >>> a = "TCCCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGT

Re: [Tutor] Splitting text

2006-06-29 Thread Dave Kuhlman
On Thu, Jun 29, 2006 at 01:06:54PM -0700, Matthew White wrote: > Hello Appu, > > You can use the count() method to find the number of occurances of a > substring within a string: > > >>> a = 'TCCCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGTCACATTTA' > >>> a.count('ATTTA') > 2 > And, if you need to search

Re: [Tutor] Splitting text

2006-06-29 Thread Matthew White
Hello Appu, You can use the count() method to find the number of occurances of a substring within a string: >>> a = 'TCCCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGTCACATTTA' >>> a.count('ATTTA') 2 -mtw On Thu, Jun 29, 2006 at 12:45:06PM -0700, Apparao Anakapalli ([EMAIL PROTECTED]) wrote: > hello all:

[Tutor] Splitting text

2006-06-29 Thread Apparao Anakapalli
hello all: I have a question and I do not know how I can work it out. I have a file of sequences >a TCCCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGTCACATTTA' >b CCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGTCACAATTTAA' (10 K) pattern = 'ATTTA' I want to find the pattern in the sequence and count. For ins

[Tutor] classes and functions

2006-06-29 Thread anil maran
how to use classes and functions in python thanks __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Tutor maillist - Tutor@python.org http://ma

Re: [Tutor] How to check a files size

2006-06-29 Thread Danny Yoo
>> Why isn't this function in the os module with the other file commands? > > I don't know why they are broken up in this way. The glob module also > has some file access commands. For the most part, the 'os' module follows the interface functions that C provides to access the operating system.

[Tutor] Threading synchronization (was: Unit testing

2006-06-29 Thread Terry Carroll
On Thu, 29 Jun 2006, Tino Dai wrote: > Between the producer and consumer threads, does the consumer end of the > queue sit there and wait for something to come down the queue... Yes. The following call: workunit = self.inQ.get(True) means, try to take something off the queue, and if the que

[Tutor] python multimedia cyber classrom

2006-06-29 Thread josip
Hi,   I know that this is not question for this tutor, but someone please help. I tried everething but just not working. I contact Deitel, but they don't know    I have Python multimedia cyber classroom cd with book Python how to program. When I run My cyberclassroom I get this error:   A

Re: [Tutor] Unit testing

2006-06-29 Thread Tino Dai
Okay, I was bored tonight, so I cooked up an illustration.Thanks for that! Here's an example with five stages.  Stage 1 takes a string and fills aninput queue with a series of letters from the string.  Stages 2-4 do just take a letter off its input queue and move it to its output queue.  Stage5 ta

Re: [Tutor] Unit testing

2006-06-29 Thread Terry Carroll
On Wed, 28 Jun 2006, Terry Carroll wrote: > On Wed, 28 Jun 2006, Tino Dai wrote: > > > Ok, I think I'm going to back up and explain what I'm am heading towards. > > I'm working on an app that fire off a bunch of threads. Each one of these > > threads in connected via queues to another thread in a

Re: [Tutor] How to check a files size

2006-06-29 Thread Kent Johnson
> From: "John Fouhy" <[EMAIL PROTECTED]> > > On 29/06/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > > See shutil.copyfile() > > Why isn't this function in the os module with the other file commands? I don't know why they are broken up in this way. The glob module also has some file access comma