현재 유니 할당에서 walk
메서드를 사용하고 있습니다. 모든 것이 잘 작동하지만 누군가가 나에게 설명 할 수 있기를 바랬습니다.Python os.path.walk() 메서드
아래 예제에서 myvisit
방법에 사용되는 a
매개 변수는 무엇입니까?
>>> from os.path import walk
>>> def myvisit(a, dir, files):
... print dir,": %d files"%len(files)
>>> walk('/etc', myvisit, None)
/etc : 193 files
/etc/default : 12 files
/etc/cron.d : 6 files
/etc/rc.d : 6 files
/etc/rc.d/rc0.d : 18 files
/etc/rc.d/rc1.d : 27 files
/etc/rc.d/rc2.d : 42 files
/etc/rc.d/rc3.d : 17 files
/etc/rc.d/rcS.d : 13 files
os.path.walk'가되지 않습니다'사용'os.walk' – SilentGhost
이 os.path.exists'와'os.path.isdir''에 대한 그 같은입니까? –