473,320 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Python - To find region between start.start and end.start

for my code

Expand|Select|Wrap|Line Numbers
  1. for orf in [mydna[start.start():end.start()+3] for start in re.finditer('(?=ATG)',mydna
  2.            for end in re.finditer('(?=TAA|TAG|TGA)',mydna if end.start()>start.start() and (end.end()-start.start())%3 == 0]:
  3.         #print orf
How to make the program stop at the first end regions .
Dec 12 '11 #1

✓ answered by Glenton

Hard to engage with this level of detail, but let me try. You probably want to add in a line like this:
Expand|Select|Wrap|Line Numbers
  1. if orf==ConditionMeaningFirstEndRegion:
  2.     break
The key word I suppose you're looking for is "break" which takes you out of the loop.

1 2299
Glenton
391 Expert 256MB
Hard to engage with this level of detail, but let me try. You probably want to add in a line like this:
Expand|Select|Wrap|Line Numbers
  1. if orf==ConditionMeaningFirstEndRegion:
  2.     break
The key word I suppose you're looking for is "break" which takes you out of the loop.
Dec 13 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
1
by: George Sakkis | last post by:
Hi all, I started writing a module to reproduce Gnu-find functionality in python (as far as I know, there's not one available; pyfind (http://www.anti-particle.com/pyfind.shtml) seems a bit...
1
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
108
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would...
4
by: vbMark | last post by:
Greetings, (Using C# express 2005 beta) Is there any tool or script that will wrap a procedure in a #region and put the name of the procedure in the region name? Thanks! --
0
by: Thomas Ploch | last post by:
Hello folks, I am thinking about reading and understanding the Source Code of Python, but where would it be best to start? Possibly someone can give me a little hint. I am getting into...
1
by: walterbyrd | last post by:
Lets suppose, I want a listing of what hardware and software is installed on my windows box. Can I do that with Python?
4
by: psychofish25 | last post by:
I just have one simple question. How do I open a python script from the interactive window? Or do I have to go to File->Open?
0
by: Yue Fei | last post by:
I have a multi thread python code, threads can start immediately if I run on command line, but I can get them started right the way if I call the same code from C/C++. test code like this: from...
1
by: dotpranay | last post by:
Hi, I am working on a C# based monitoring application mostly using WMI to do the monitoring. I have a requirement of finding the last start time of a windows service i.e., the exact time when the...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.