循环通过网络上的目录中,并显示其内容(文件和其他目录),在同样的Process a set of files from a source directory to a destination directory in Python我想知道是否有可能创建一个函数,给定一个网站目录时,它会列出所述目录中的文件。喜欢的东西...通过Python
files[]
for file in urllib.listdir(dir):
if file.isdir:
# handle this as directory
else:
# handle as file
我认为我会需要使用的urllib库,但似乎并没有被这样做的一个简单的方法,那我至少见过。