Re: [Tutor] Table of replacements for deprecated fns from 'string'module?

2007-06-14 Thread Alan Gauld
"Stephen McInerney" <[EMAIL PROTECTED]> wrote > Where is there a table of replacements for the deprecated 'string' > fns I'm not sure exactly what you are after but comparing these lists might help: import string dir(string) ['Template', '_TemplateMetaclass', '__builtins__', '__doc__', '__fi

Re: [Tutor] Componentone - TrueDBGrid Control

2007-06-14 Thread Alan Gauld
"Pradeep Kumar" <[EMAIL PROTECTED]> wrote > Is wxPython have Componentone Trudbgrid like control. If yes, > Please inform. if No, how we can made one. I've no idea what a Trudbgrid is but assuming it's a bit like the live data grids used in Delphi then the answer is no, not as far as I can tel

[Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread emilia12
hi list, how to choose between "#!/usr/bin/env python" and "#!/usr/local/bin/python" in the beginning of the script ? e. - SCENA - Ĺäčíńňâĺíîňî ÁĹÇĎËŔŇÍÎ ńďčńŕíčĺ çŕ ěîáčëíč ęîěóíčęŕöčč č ňĺőíîëîăčč. http://www.bgscena.com/ _

Re: [Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread Thorsten Kampe
* (Thu, 14 Jun 2007 13:14:13 +0300) > how to choose between "#!/usr/bin/env python" and > "#!/usr/local/bin/python" in the beginning of the script ? Just choose. Say "I want" to the script. Say "I want '#!/usr/bin/env python'" ___ Tutor maillist - T

[Tutor] Automatic generation of an "all possible combinations" array

2007-06-14 Thread Andy Cheesman
Hi people I am trying to generate an array of all possible combinations of 1, and zeros (see example data) for a rather nice Kinetic mote Carlo program which I am writing python. So far, I've been working out for combinations for 4 or less species by hand as it is quick! but I am looking to automa

Re: [Tutor] Automatic generation of an "all possible combinations" array

2007-06-14 Thread Hugh M
The 2**n different lists that you are seeking have a direct association to the binary representation of the integers 0 through (2**n)-1. You can use this fact and the "repeated division method" for converting numbers between different bases to generate these lists and form the desired list of list

Re: [Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread Ezra Taylor
I think Emilia means what's the difference. From what little I know, #!/usr/bin/env python will choose the first python that's in your path. Were as the second option, you explicitly choose which instance of python you want. I'm using using python from Activestate. So my shebang is to the Activ

Re: [Tutor] locking files

2007-06-14 Thread Vishnu Mohan
You can look into the flock or lockf methods in fcntl module (or) the following link will help you http://www.python.org/doc/2.4/lib/module-fcntl.html VishnuMohan Alan Gauld wrote: "Jeff Peery" <[EMAIL PROTECTED]> wrote does anyone know if there is a way in python to lock a file so othe

[Tutor] Certificate creation.

2007-06-14 Thread Lance Haig
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi All, Is there a way to create ssl certificates with python and GNUTLS? I am part of a project http://www.bongo-project.org which is a mail and calendering solution. We use python in our project to a large extent but we have a problem with the ssl

Re: [Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread David Duncan
On 6/14/07, Ezra Taylor <[EMAIL PROTECTED]> wrote: I think Emilia means what's the difference. From what little I know, #!/usr/bin/env python will choose the first python that's in your path. Were as the second option, you explicitly choose which instance of python you want. I'm using using py

Re: [Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread Senthil_OR
Okay, I guess, people are missing points here. When do you #!/usr/local/bin/python You are specifying the location to the python executable in your machine, that rest of the script needs to be interpreted with. You are pointing to python is located at /usr/local/bin/python Consider the poss

Re: [Tutor] Automatic generation of an "all possible combinations" array

2007-06-14 Thread Vishnu Mohan
Another simplest way of doing it is >>> from random import * from sys import * def bin_list(n): bin_val = 0 if n >= 0: bin_val = 2**n - 1 list = [] while bin_val >= 0: list.append([((bin_val >> y) & 1) for y in range(n-1,-1,-1)]) bin_val -= 1 shuffle(

Re: [Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread wesley chun
> Okay, I guess, people are missing points here. > > #!/usr/local/bin/python > You are specifying the location to the python executable in your machine, > that rest of the script needs to be interpreted with. > You are pointing to python is located at /usr/local/bin/python > > Consider the possibli

[Tutor] Finding all locations of a sequence

2007-06-14 Thread Lauren
Ok, please bear with me, I'm very new to programming and python. And my question is rather...convoluted. I have a bunch of sequences (about 4100 or so), and want to know where they are in a very, very large string of letters. But wait, there's more. Some of these sequences match to more than 'word

Re: [Tutor] Get max quantity

2007-06-14 Thread Kent Johnson
Brian Wisti wrote: > Hi Carlos, > > On 6/13/07, Carlos <[EMAIL PROTECTED]> wrote: >> Hello, >> >> If I have a dictionary like: >> >> inventory = {'apples': 430, 'bananas': 312, 'oranges': 525, 'pears': 217} >> >> How can I get the item with the largest quantity? I tried: >> >> max(inventory) >> >>

Re: [Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread Rolando Pereira
[EMAIL PROTECTED] escreveu: > Okay, I guess, people are missing points here. > > When do you > > #!/usr/local/bin/python > You are specifying the location to the python executable in your machine, > that rest of the script needs to be interpreted with. > You are pointing to python is located

Re: [Tutor] Finding all locations of a sequence

2007-06-14 Thread Teresa Stanton
OK, I'm going to take a shot at this. If what I'm understanding is correct, a dictionary might help. But that would depend on the format of the original sequence. If you have a list: Lst1 = ['cow', 'pig', 'chicken', 'poultry', 'beef', 'pork'] Then you could: Lst1.index('chicken') And get 2,

Re: [Tutor] Finding all locations of a sequence

2007-06-14 Thread Paulo Nuin
Hi Lauren You can use two approaches: 1- String method find This returns a int value with the lowest position of your search on the string (sequence) you are searching. From the documentation: *find*( sub[, start[, end]]) Return the lowest index in the string where substring sub is found, suc

Re: [Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread Bill Campbell
On Thu, Jun 14, 2007, Rolando Pereira wrote: >[EMAIL PROTECTED] escreveu: >> Okay, I guess, people are missing points here. >> >> When do you >> >> #!/usr/local/bin/python >> You are specifying the location to the python executable in your machine, >> that rest of the script needs to be inter

Re: [Tutor] Finding all locations of a sequence

2007-06-14 Thread Lauren
Ok, what I have is a RNA sequence (about 5 million nucleotides [characters] long) and have (4100) subsequences (from another sequence) and the sub-sequences are 6 characters long, that I want to find in it. The problem is the exceptional bond of U:G, which results in U bonding to A (as per normal)

Re: [Tutor] Finding all locations of a sequence

2007-06-14 Thread Paulo Nuin
Hi Lauren I use the find string method to search DNA motifs. Here is an example while sp < len(fasta[j].sequence): pos = string.find(fasta[j].sequence, motif[i], sp) if pos != -1 and pos > 0:

Re: [Tutor] Finding all locations of a sequence

2007-06-14 Thread Terry Carroll
On Thu, 14 Jun 2007, Lauren wrote: > Subseq AU can bind to UA (which is normal) and UG (not so > normal) and I want to know where UA, and UG are in the large > RNA sequence, and the locations to show up as one...thing. How about something like this? =

Re: [Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

2007-06-14 Thread Alan Gauld
>From the welter of posts, coming back to the original, let's summarise: <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > how to choose between "#!/usr/bin/env python" and > "#!/usr/local/bin/python" in the beginning of the script ? Use env if you want maximum flexibility across dif

Re: [Tutor] Finding all locations of a sequence

2007-06-14 Thread Alan Gauld
"Lauren" <[EMAIL PROTECTED]> wrote Caveat: I am not into the realms of DNA sequencing so this may not be viable but... > Say I have chicken and I want to know where it occurs in a string of > words, but I want it to match to both chicken and poultry and have > the > output of: > > chicken (loca