[Tutor] UNICODE BEST RESPONSE

2006-09-23 Thread anil maran
Hum, I don't have any problems, and I don't do anything special ... - I use PostgreSQL, so I created my database using UTF-8 encoding. - my Python modules start with "# -*- coding: utf-8 -*-". - all my modules and my templates are utf-8 encoded (I use Vim, so I use ":set encoding=utf-8", but it sh

Re: [Tutor] looping problem

2006-09-23 Thread Kent Johnson
John Fouhy wrote: > On 24/09/06, Python <[EMAIL PROTECTED]> wrote: >> slices may be the best way to go >> listA = biglist[0::3] # start from index 0 taking every third element >> listB = biglist[2::3] # start from index 2 taking every third element > > I'm not certain they would be.. If you do

Re: [Tutor] looping problem

2006-09-23 Thread John Fouhy
On 24/09/06, Python <[EMAIL PROTECTED]> wrote: > slices may be the best way to go > listA = biglist[0::3] # start from index 0 taking every third element > listB = biglist[2::3] # start from index 2 taking every third element I'm not certain they would be.. If you do that, you will: 1. Create

Re: [Tutor] Tutor Digest, Vol 31, Issue 66

2006-09-23 Thread R. Alan Monroe
>> >> Message: 4 >> Date: Sat, 23 Sep 2006 08:38:37 +0100 >> From: "Alan Gauld" <[EMAIL PROTECTED]> >> Subject: Re: [Tutor] Fatal error after RE-installing Python 2.3.4 >> To: tutor@python.org >> Message-ID: <[EMAIL PROTECTED]> >> Content-Type: text/plain; format=flowed; charset="iso-8859-1"; >>

Re: [Tutor] (no subject)

2006-09-23 Thread Luke Paireepinart
Jeff Sadino wrote: > I would like to write a python script that runs an executable program. If I > have a program here: > > C:\My Document\Program.exe > > how would I execute that program from within a python script? > you could use the os module. os.system() lets you run system commands. Or m

[Tutor] (no subject)

2006-09-23 Thread Jeff Sadino
I would like to write a python script that runs an executable program. If I have a program here: C:\My Document\Program.exe how would I execute that program from within a python script? Thank you, Jeff Sadino ___ Tutor maillist - Tutor@python.org

Re: [Tutor] looping problem

2006-09-23 Thread Kent Johnson
kumar s wrote: > hi, > > thank you. this is not a homework question. > > I have a very huge file of fasta sequence. > > I want to create a dictionary where 'GeneName' as key > and sequence of ATGC characters as value > > > biglist = dat.split('\t') > ['GeneName ','','ATTAAGG

Re: [Tutor] looping problem

2006-09-23 Thread jim stockford
#!/usr/bin/python # or whatever is the absolute path to python on your system counter = 0 for i in "a","b","c","d","e","f","g" : if counter%3 == 0 : print i + " list one ", counter, counter%3 if counter%3 == 1 : print i + " list two ", counter, cou

Re: [Tutor] Tutor Digest, Vol 31, Issue 66

2006-09-23 Thread Tony Cappellini
Message: 4Date: Sat, 23 Sep 2006 08:38:37 +0100From: "Alan Gauld" < [EMAIL PROTECTED]>Subject: Re: [Tutor] Fatal error after RE-installing Python 2.3.4To: tutor@python.orgMessage-ID: < [EMAIL PROTECTED]>Content-Type: text/plain; format=flowed; charset="iso-8859-1";reply-type=original>>Have

Re: [Tutor] looping problem

2006-09-23 Thread Python
On Sat, 2006-09-23 at 09:03 -0700, kumar s wrote: > hi, > > thank you. this is not a homework question. > > I have a very huge file of fasta sequence. > > > GeneName \t > AATTAAGGAA.. > > > > > > (1000 lines) > AATAAGGA > >GeneName \t > GGAG

Re: [Tutor] looping problem

2006-09-23 Thread Bob Gailer
kumar s wrote: > [snip] > so I want to select 0,3,6,9 elements into listA > and 2,5,8,11 and so on elements into listB > > Here's a hint: for j in range(0, len(biglist), 3): # this will set j = 0, 3, 6, etc. -- Bob Gailer 510-978-4454 ___ Tutor mai

Re: [Tutor] looping problem

2006-09-23 Thread kumar s
hi, thank you. this is not a homework question. I have a very huge file of fasta sequence. > GeneName \t AATTAAGGAA.. (1000 lines) AATAAGGA >GeneName \t GGAGAGAGATTAAGAA (15000 lines) when I read this as: f2= open('myfile','r') dat = f2.

Re: [Tutor] looping problem

2006-09-23 Thread jim stockford
keep a counter in your loop. is this a homework question? On Sep 23, 2006, at 8:34 AM, kumar s wrote: > hi, > > the reason could be that I did not quite understand > the concept of looping > > I have a list of 48 elements > > I want to create another two lists , listA and listB > > I want to loo

[Tutor] looping problem

2006-09-23 Thread kumar s
hi, the reason could be that I did not quite understand the concept of looping I have a list of 48 elements I want to create another two lists , listA and listB I want to loop through the list with 48 elements and select element with index 0,3,6,9,12 ..etc into listA select elements with

Re: [Tutor] Fatal error after RE-installing Python 2.3.4

2006-09-23 Thread Kent Johnson
Tony Cappellini wrote: > > I've just started a job which has a massive python2.3.4-centric tools > installation and configuration. > > I know what you're going to say, but I can't upgrade and be the only one > with a newer version. There are close to 30 engineers using this same > tools config

Re: [Tutor] Fatal error after RE-installing Python 2.3.4

2006-09-23 Thread Alan Gauld
> I've just started a job which has a massive python2.3.4-centric > tools > installation and configuration. > > I know what you're going to say, but I can't upgrade and be the only > one > with a newer version. There are close to 30 engineers using this > same tools > configuration, and it has b