我正在尝试将一行中的特定字符“r”本地化,然后检索每侧的35个字符。可能有不止一个“r”,所以我试图获得所有这些。我一直在尝试这个代码,但我只是得到标题,我无法弄明白。有什么建议吗?
fhand=open("input.txt")
target = open ("output.txt", "a")
for line in fhand:
name, id, seq= line.split("\t")
while atpos < len(seq):
if atpos == -1:
break
atpos = seq.find ("r")
seq2 = seq[(atpos-35):(atpos+36)]
line2= name + "\t"+ id + "\t" + seq2 + "\n"
target.write(line2)
atpos += 1
print ("Sequences obtained successfully")
target.close()
答案 0 :(得分:0)
#include "OutboundLogicAdaptor.h"
OutboundLogicAdaptor::OutboundLogicAdaptor(TrialModel *modelHook, TrialLogic &logicHook) : logic(logicHook)
{
this->hook = modelHook;
signalConnection = logic.connect(boost::bind(&OutboundLogicAdaptor::transmitAngle, this, _1));
}
OutboundLogicAdaptor::~OutboundLogicAdaptor()
{
signalConnection.disconnect();
}
void OutboundLogicAdaptor::transmitAngle(int angle){
hook->postAngle(angle);
}