Re: [Tutor] Strings

2014-11-05 Thread Dave Angel
William Becerra Wrote in message: > have the following code: names = "John, Cindy, Peter" def find(str, ch, s): index = 0 while index < len(str): if s==1: for char in names[:4]: if str[index] == ch: return index + 1

Re: [Tutor] Subprocess how to use?

2014-11-05 Thread Cameron Simpson
On 05Nov2014 14:05, jarod...@libero.it wrote: I need to use external program from my scirpt. code = "intersectBed -a %s -b /database/Refseq_Gene2.bed -wa -wb|cut -f 4,8|uniq > tmp.tmp1"%("gene5.tmp.bed") code2 = "intersectBed -a %s -b /database/Refseq_Gene2.bed -wa -wb|cut -f 4,8|uniq > tm

Re: [Tutor] Strings

2014-11-05 Thread Peter Otten
William Becerra wrote: > Hey, I'm new to programming > running Python 2.7.8 Windows 8.1 > I was reading 'How to Think Like a Computer Scientist- Learning with > Python' chapter 7 sub-chapter 7.7 > > I have the following code: > names = "John, Cindy, Peter" > def find(str, ch, s): > index = 0

Re: [Tutor] Strings

2014-11-05 Thread Alan Gauld
On 05/11/14 13:19, William Becerra wrote: names = "John, Cindy, Peter" def find(str, ch, s): index = 0 while index < len(str): if s==1: for char in names[:4]: if str[index] == ch: return index + 1 index = inde

[Tutor] Strings

2014-11-05 Thread William Becerra
Hey, I'm new to programming running Python 2.7.8 Windows 8.1 I was reading 'How to Think Like a Computer Scientist- Learning with Python' chapter 7 sub-chapter 7.7 I have the following code: names = "John, Cindy, Peter" def find(str, ch, s): index = 0 while index < len(str): if s==

[Tutor] Subprocess how to use?

2014-11-05 Thread jarod...@libero.it
Dear All, I need to use external program from my scirpt. code = "intersectBed -a %s -b /database/Refseq_Gene2.bed -wa -wb|cut -f 4,8|uniq > tmp.tmp1"%("gene5.tmp.bed") code2 = "intersectBed -a %s -b /database/Refseq_Gene2.bed -wa -wb|cut -f 4,8|uniq > tmp.tmp2"%("gene3.tmp.bed") proc =