def lastpos(findstr,mystr):
        #gp.AddMessage("查询=======:"+findstr+","+mystr)
        num=len(mystr)
        #gp.AddMessage("长度:"+str(num))
        findnum=len(findstr)
        #gp.AddMessage("长度,findnum="+str(findnum))
        i=num-findnum
        #gp.AddMessage("查询:i="+str(i)+",num="+str(num))
        while i>0:               
                p=mystr.find(findstr,i,num)
                #gp.AddMessage("查询:p="+str(p))
                if p>0:
                        return p
                i=i-1
               
      


def gettfh(filename): #获得图幅号
        filepath=os.path.dirname(filename)
        #gp.AddMessage("查询:p="+filepath)
        p=lastpos("\\",filepath)
        num=len(filepath);
        return filepath[p+1:num]

相关文章:

  • 2021-12-13
  • 2021-09-15
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-01
  • 2022-01-07
  • 2022-12-23
  • 2021-08-24
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案