ArcGIS Server JavaScript API中ESRI字体下载

----------------------------------------------------------------------------------

import sys, os
import httplib, urllib, urllib2
import urlparse
import json
import traceback
import time
#
baseUrl = 'https://static.arcgis.com/fonts/arial-unicode-ms-regular/'
basePath = 'D:/fonts/arial-unicode-ms-regular/'
# https://static.arcgis.com/fonts/arial-unicode-ms-regular/256-510.pbf

def downRegular():
    try:
      for i in range(0, 256):
        fileName = str(i * 256) + '-' + str((i+1)*256 - 1) + '.pbf'
        url = baseUrl + fileName
        req = urllib2.Request(url)
        response = urllib2.urlopen(req)
        if response.getcode() == 200:
            data = response.read()
            response.close()
            with open(basePath + fileName, "wb") as code:
              code.write(data)
        print(fileName)
        time.sleep(1)
    except Exception,e:
        print("error info: {0}".format(traceback.format_exc()))


def main():
    downRegular()

if __name__ == '__main__':
    main()

----------------------------------------------------------------------------------

30人参与, 0条评论 登录后显示评论回复

你需要登录后才能评论 登录/ 注册