title: python to generate html color table output
body: <p>I am planning write HTML table with color using python script.</p>
  
  <p>I got below script in below link and started testing.
  <a href="https://www.decalage.info/python/html" rel="nofollow noreferrer">Click here </a></p>
  
  <pre><code> from html import HTML
   import sys
   import os
   table_data = [
          ['Last name',   'First name',   'Age'],
          ['Smith',       'John',         30],
          ['Carpenter',   'Jack',         47],
          ['Johnson',     'Paul',         62],
      ]
  htmlcode = HTML.table(table_data)
  
  f = open("file123.html", 'w')
  sys.stdout = f
  
  f.close()
  </code></pre>
  
  <p>When I execute above code. I am getting below error.</p>
  
  <pre><code>Traceback (most recent call last):
    File "c:\Users\bob\Documents\scripts\html\html.py", line 10, in &lt;module&gt;
      htmlcode = HTML.table(table_data)
  AttributeError: type object 'HTML' has no attribute 'table'.
  </code></pre>
  
  <p>Is there any easiest way we can create table with color from python script</p>
  
  <p>I am using python 2.7 in windows 10 OS.</p>