测试代码编辑器

13年前
def dfm2d(d,f,m):    temp=m/60.0    temptemp=temp+f    res=d+temp/60.0    return res     def u(s):    return s.decode('utf8')    def gridnn(n,x,y,xs,xe,ys,ye):    dx=(xe-xs)/(n+0.0)    dy=(ye-ys)/(n+0.0)    for i in range(1,n+1):    if y>=(ye-i*dy):    break    tempy=i   for i in range(1,n+1):    if x<=(xs+i*dx):    break    tempx=i   return (tempy-1)*n+tempx    #main    print u('欢迎使用\n系列比例尺地形图分幅编号计算\nPowered by FanZhenzhen IEU Version 1.0\n')    Ld=int(raw_input(u('输入经度L度数:')))     Lf=int(raw_input(u('输入经度L分数:')))    Lm=int(raw_input(u('输入经度L秒数:')))    Bd=int(raw_input(u('输入纬度B度数:')))    Bf=int(raw_input(u('输入纬度B分数:')))    Bm=int(raw_input(u('输入纬度B秒数:')))    L=dfm2d(Ld,Lf,Lm)    B=dfm2d(Bd,Bf,Bm)        计算1:100万图幅编号  Seq100_hang=int(B/4)+1    Seq100_lie=int(L/6)+31    Le100=(Seq100_lie-30)*6    Bn100=Seq100_hang*4    print u('1:100万图幅编号 '),Seq100_hang,'-',Seq100_lie