Python is a platform-independent scripting language that can be used to program dynamic websites. At IONOS, Python is available in Linux web hosting packages and on Managed Dedicated Server.

The following file extensions are allowed for Python scripts:

  • .py

  • .cgi

  • .pl

Program Example Simple Visitor Counter

An example of a simple visitor counter made in Python:

#!/usr/bin/python

import string

print "Content-Type: text/html\n\n"

f=open('count.db', 'r+') 

number=f.read()

print "<p>This page has been viewed <b>" + number + "</b> times.</p>"
a = int (number)+1
f.seek(0)
f.write(repr(a))
f.close()