Skip to content
  • 首页
  • GIS理论
  • 二次开发
    • deck.gl
    • leaflet
    • openlayers
    • mapboxgl
    • 百度地图开发
    • Current Page Parent ArcPy
    • ArcEngine
    • geotools
    • QGIS
    • cesium
    • ArcGIS
      • arcgis api for javascript
        • ArcGIS API For JavaScript官方文档
        • 3.x
        • 4.x
      • ArcGISServer
  • 算法
    • GDAL
    • PROJ
    • OGR
    • Geotrellis
  • GIS前沿
    • GIS+BIM
    • GIS人工智能
    • GIS大数据
    • GIS新闻
  • 数据分析
  • 前端
    • JavaScript
    • vue
    • es6
    • CSS
    • html5
  • 后端
    • C#
    • Java
    • redis
    • nodejs
    • Python
      • Python教程
      • Scrapy教程
      • Python数据分析
      • pyspider
  • 操作系统
    • windows
    • centos
    • ubuntu
    • macos
  • 数据库
    • PostGreSQL
    • MongoDB
    • Oracle
      • oraclespatial
    • MySQL
  • GIS数据
    • 数据源
    • ArcMap
    • CAD
    • GeoServer
  • 精选专区
  • 开发工具
  • GIS分析
  • GIS软件
  • 数据中心
  • 源码
  • 登录
  • 注册
  • 版权说明

GIS开发者

gis,openlayers,leaflet,gis应用,geoai,geoserver,cesium,python,arcpy,arcmap,webgis,gis可视化

  • 首页
  • GIS理论
  • 二次开发
    • deck.gl
    • leaflet
    • openlayers
    • mapboxgl
    • 百度地图开发
    • Current Page Parent ArcPy
    • ArcEngine
    • geotools
    • QGIS
    • cesium
    • ArcGIS
      • arcgis api for javascript
        • ArcGIS API For JavaScript官方文档
        • 3.x
        • 4.x
      • ArcGISServer
  • 算法
    • GDAL
    • PROJ
    • OGR
    • Geotrellis
  • GIS前沿
    • GIS+BIM
    • GIS人工智能
    • GIS大数据
    • GIS新闻
  • 数据分析
  • 前端
    • JavaScript
    • vue
    • es6
    • CSS
    • html5
  • 后端
    • C#
    • Java
    • redis
    • nodejs
    • Python
      • Python教程
      • Scrapy教程
      • Python数据分析
      • pyspider
  • 操作系统
    • windows
    • centos
    • ubuntu
    • macos
  • 数据库
    • PostGreSQL
    • MongoDB
    • Oracle
      • oraclespatial
    • MySQL
  • GIS数据
    • 数据源
    • ArcMap
    • CAD
    • GeoServer
  • 精选专区
  • 开发工具
  • GIS分析
  • GIS软件
  • 数据中心
  • 源码
  • ArcPy

[迁移]遍历指定文件夹下的所有文件,python

by giser · 2019-04-24


声明:因网易博客将关闭,移到此

# -*- coding:utf8 -*-

import os,codecs

#--------------------------
# param path 要搜索文件的目录
# param t 保存文件的列表
def findfiles(path, t):
    files = os.listdir(path);
    for f in files:
        npath = path + '/' + f;
        if(os.path.isfile(npath)):
            t.append(npath);
        if(os.path.isdir(npath)):
            if (f[0] == '.'):
                pass;
            else:
                findfiles(npath, t);
    return;
            
            
t = [];
#path = "F:/test_lua/Resources/hd/Images";
path = "G:/练手区";
findfiles(unicode(path, 'utf8'), t);

for fn in t:
    print(fn);


查询文件就是一个很悲惨的事情,留着这里后面用到好拿

转载自:https://blog.csdn.net/holmes_huang/article/details/86695717

Tags: [迁移]遍历指定文件夹下的所有文件,pythonArcPy

  • Next story 【287】◀▶ arcpy 常用类说明
  • Previous story 【python】字符串问题

You may also like...

  • arcgis sde 数据库迁移

    2019-04-24

  • 利用Arcpy发布地图服务,制作切片

    2019-04-24

  • 使用arcpy把hdf格式的遥感影像转换为TIFF格式

    2019-04-24

公众号

微信群

人数过多只能拉人进群;

加我好友yu389741

微信小程序

GIS开发者
京ICP备 18040113号
  • CSDN
  • GeoAI
  • 中国程序员
  • 博客园
  • 站点地图
  • 吾爱地理
  • 地理导航

GIS开发者 © 2026. All Rights Reserved.

Powered by WordPress. Theme by Alx.