def path(request, mypath):
mypath = request.path_info
_listdir = os.listdir(mypath) # ['folder1', 'folder2', 'folder3', 'folder4']
mess = _listdir
a = ' '
x=0
scope = vars()
for i in mess:
scope['x']+=1
a += mess[x]
a += '\n'
return HttpResponse(a)
I hope the output is like this:
folder1 folder2 folder3 folder4
but why the output just like this:
folder1 folder1 folder1 folder1
any help?