#!/usr/bin/python2

#auth:codewalker #mail:001@codewalker.me

import sys
import os

def scandir(p):
try:
items = os.listdir(p)
except OSError:
print ‘OSError, Could not Open dir: %s’ % p
exit(1)
for element in items:
fullpath = p + ‘/‘ + element
if os.path.isdir(fullpath):
scandir(fullpath)
print fullpath
def main():
if len(sys.argv) == 2:
path = sys.argv[1]
print ‘path is: %s’ % path
else:
path = os.getcwd()
print ‘No arg, Using cwd is: %s’ % path
scandir(path)

if __name__ == “__main__“:
main()