Re: [Tutor] Help me with two dimensional arrays in Python

2006-10-04 Thread Matthew White
Asrarahmed, How about something like this: >>> arr = [] >>> arr.append(['Blue', 'Yellow', 'Green', 'Brown', 'White']) >>> arr[0][0] 'Blue' >>> arr.append(['Up', 'Down', 'Left', 'Right', 'Center']) >>> arr[1][4] 'Center' Is this what you were thinking of? -mtw On Wed, Oct 04, 2006 at 06:38:09P

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:

Re: [Tutor] File compression

2006-06-27 Thread Matthew White
Hi Magnus, I would check out the python tarfile module: http://docs.python.org/lib/module-tarfile.html Looks like it will compress with bzip too! -mtw On Wed, Jun 28, 2006 at 12:19:19AM +0200, Magnus Wirström ([EMAIL PROTECTED]) wrote: > Hi Everyone > > I'm starting to python and i need to w

Re: [Tutor] Delete directories recursively

2006-06-16 Thread Matthew White
You must change the directory and file permissions before attempting to remove them; even if you are using a python script. Take a look at os.chmod() -mtw On Fri, Jun 16, 2006 at 10:26:34AM -0500, Amresh Kulkarni ([EMAIL PROTECTED]) wrote: > Hi, > > I need to delete a directory and its sub di

Re: [Tutor] ossaudiodev, pygtk, and flushing buffers

2006-05-11 Thread Matthew White
May 2006 09:59:14 -0700 > Matthew White <[EMAIL PROTECTED]> wrote: > > > Hello All, > > > > I'm writing a little audio player that plays voicemail files. (I realize > > I'm reinventing the wheel, but it's still fun.) > > > > The

[Tutor] ossaudiodev, pygtk, and flushing buffers

2006-05-11 Thread Matthew White
Hello All, I'm writing a little audio player that plays voicemail files. (I realize I'm reinventing the wheel, but it's still fun.) The problem I'm experiencing is that I'm hearing the last fraction of the sound clip twice, either when the clip is done playing or when the program exits. I've tr

Re: [Tutor] Halting execution

2006-05-03 Thread Matthew White
. > > I'm running under ipython on windows, FWIW. > > Thanks > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor -- Matthew White - District Systems Administrator Tigard/Tualatin School D

Re: [Tutor] [Linux] open a file in any home "~" ?

2006-04-19 Thread Matthew White
t; How can I do to access this file whatever the user is ? > > Thanks for your help. > > --- > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor -- Matthew

Re: [Tutor] OOPs Concept

2006-04-19 Thread Matthew White
de', 'encode', 'endswith', 'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', &#

Re: [Tutor] OOPs Concept

2006-04-19 Thread Matthew White
> > I have been reading http://www.freenetpages.co.uk/hp/alan.gauld/tutclass.htm > but at the moment still the concept is not clear > > Thanks in Advance > > Regards > > Kaushal > ___ > Tutor maillist - Tutor@python.org

Re: [Tutor] Question about list

2006-04-10 Thread Matthew White
lement > of that list: > > spam! = 1 element > 2 = 1 element > ['Ted', 'Rock'] = 2 elements > > Could anyone, please, give me some hints? > Thanks, > Hoffmann > > > __ > Do You Yahoo

Re: [Tutor] Space the final frontier!

2006-04-04 Thread Matthew White
al=02890419689, dial='] > 003, newcomp, dial=02890419689, dial= 003, newcomp, dial=02890419689, dial= > > Any help would be greatly appreciated. > > Regards, > > John. > > ___ > Tutor maillist - Tut

[Tutor] for loops and exceptions

2006-03-29 Thread Matthew White
I tend to like to get very compact, which can be an impediment to code readability. As I get started with python I want to make sure that I don't repeat the same mistakes and let too many perl-isms creep into my python code. -mtw -- Matthew White - District Systems Administrator Tigar

Re: [Tutor] What is wrong my code?

2006-03-24 Thread Matthew White
f spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor -- Matthew White - District Systems Administrator