学习笔记28—Python 不同数据类型取值方法

1、array数据类型

  1)-------> y[i,] 或者 y[i]

2、遍历目录下所有文件夹:

      def eachFile(filepath):

    pathDir =  os.listdir(filepath)

    for allDir in pathDir:
       child = os.path.join('%s\%s' % (filepath, allDir))
       if os.path.isfile(child):
           readFile(child)
#           print child.decode('gbk') # .decode('gbk')是解决中文显示乱码问题
           continue
        eachFile(child)

   

原文地址:https://www.cnblogs.com/hechangchun/p/9844194.html