The way the list works is by looking at what modules have been installed by pip. Here's the code
#!/bin/python
print("Content-Type: text/html\n\n")
import pip
installed_packages = pip.get_installed_distributions()
installed_packages_list = sorted(["<td>%s</td><td>%s</td>" % (i.key, i.version) for i in installed_packages])
print("Tommy /bin/python installed modules:<br><br>")
print("<table><tr><th align='left'>Module</th><th align='left'>Version</th></tr>")
print("</tr><tr>".join(installed_packages_list))
print("</tr></table>")
That list won't include the python standard libraries which weren't installed with pip: https://docs.python.org/2/library/index.html