Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从应用程序输出(exe文件)的变量中获取特定值,该文件在python中为csv格式_Python_String_Function_Csv_Get - Fatal编程技术网

从应用程序输出(exe文件)的变量中获取特定值,该文件在python中为csv格式

从应用程序输出(exe文件)的变量中获取特定值,该文件在python中为csv格式,python,string,function,csv,get,Python,String,Function,Csv,Get,我想从下面的程序中得到start1,end1,start2,end2的值。如何得到它。我尝试使用get()但作为其str,我得到错误“'str'对象没有属性'get'”Self.bin是exe文件路径。{{{{{{{这可能是一个类似的问题,我尝试过使用它们,但没有得到结果。请提供下面python代码的解决方案。在结束我的问题之前。非常感谢} def run(self ) : query = self.args.query target = self.args.targ

我想从下面的程序中得到start1,end1,start2,end2的值。如何得到它。我尝试使用get()但作为其str,我得到错误“'str'对象没有属性'get'”Self.bin是exe文件路径。{{{{{{{这可能是一个类似的问题,我尝试过使用它们,但没有得到结果。请提供下面python代码的解决方案。在结束我的问题之前。非常感谢}

    def run(self ) :
     query = self.args.query
     target = self.args.target
     complete = str(self.bin + ' -q ' + query + ' -t ' + target +' --outMode=C -n 1')
     ps = s.Popen(str(complete),  stdin = s.PIPE, stdout = s.PIPE, universal_newlines=True)
     (stdout, stderr) = ps.communicate()
     self.b1 = stdout
     print("B1: \n")
     print(self.b1)

    self.block_b1(self.b1, self.b2, self.b3)



    def block_b1(self, b1, b2, b3): ############get values from above method 
     print(self.b1.get("start1"))
     print(self.b1.get("start2"))      
     print(self.b1.get('end1'))
     print(self.b1.get('end2'))



    output of self.b1 lookslike this :
B1:

id1;start1;end1;id2;start2;end2;subseqDP;hybridDP;E
target;39;45;query;98;104;UCCUGGA&UCCAGGA;(((((((&)))))));-4.37
我希望结果如下所示:

39

98

45

104
好的,首先做这个

result_array=self.b1.split(“;”)
res=[]
对于结果数组中的项:
如果项.isdigit():
资源推送(项目)
对于我在res:
印刷品(一)