>>> importos
>>>os.path.exists('d:/assist')
True
>>>os.path.exists('d:/assist/getTeacherList.py')
True
>>>os.path.isfile('d:/assist')
False
>>>os.path.isfile('d:/assist/getTeacherList.py')
True
>>>os.makedirs('d:/assist/set')
>>>os.path.exists('d:/assist/set')
True
遍历文件夹
参考
>>> defTest2(rootDir):
... for lists in os.listdir(rootDir):
... path = os.path.join(rootDir, lists)
... print path
... if os.path.isdir(path):
... Test2(path)
...
>>>Test2("F:zr")