ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

View root,dirs,files

View root,dirs,files

View root,dirs,files

Referring to os src which location of /lib/python3.12

Code:
import os
For root,dirs,files in os.walk("../tmp2"):
print('\n %s %s %s' %(root,dirs,files))

results of console:
emit here

notice for parameters to os.walk function:

if pars is wrong or equal to empty, the walk function may don't work, nothing shows on console.
"." represent current directory
".." represent parents directory

返回列表