import sys import os path = sys.argv[1] dirlist = os.listdir(path) filehandle = open ( 'dir.html', 'w') text='' for file in path: text+=''' Directory Listing of'''+file+'''
'''+dirlist+'''
''' filehandle.write (text) filehandle.close()