permission denied when creating an .html file in python
Question: so this is my first python experience. I have a list of images in folder that
I'm trying to convert to html pages. For that I have the following code:  

    
    
    import inspect, os, errno, markup
    path =  os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))+'/www/img/'
    print path
    
    for f in os.listdir(path):
      counter = 1
      page = markup.page()
      page.init(charset="UTF-8")
      from markup import oneliner as e
      page.a(e.img(src='img/'+f, width=1024, height=768), href='')
      final = open('/index'+str(counter)+'.html','w')
      final.write(page)
    

and I get an `IOError: [Errno 13] Permission denied: '/index1.html'`
message.... any clues or ideas are much appreciated. thanks!


Answer: I think the main problem is related to file permissions of root folder (`/`).
Try running the script as root or pick some other directory that you are sure
you have write access to.

