Platinum Partner

List All Files In A Special Directory (including Sub-directories)

this function can return all files name (including those ones that are in subdirectories) as a list object.


import os

def hlist(path_to):
	result=[]
	temp=os.listdir(path_to)
	for a in temp:
		try:
			if os.path.isfile(path_to+'\\'+a):
				result.append(path_to+'\\'+a)
			if os.path.isdir(path_to+'\\'+a):
				result.extend(hlist(path_to+'\\'+a))
		except:
			pass
	return(result)



for example:

a=hlist('d:')
b=hlist('f:\\photos\\')


but i donno why it doesnt work on my c: !! 

any suggestion?
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}