[Tutor] File extension for CGI scripts written in Python
Alan Gauld
alan.gauld at freenet.co.uk
Sat Nov 12 13:50:25 CET 2005
> Python. In the literature I have studied, I have seen the extensions .cgi
> and .py applied to such files. Is one preferred over the other, or is it
> a
> matter of personal preference?
It depends on how your web server hsa been set up, there are two basic
options:
1) All CGUI scripts go in a common dirdectory (usually cgi-bin) in which
case you
would name them as .py
2) You can store the CGI files with the corresponding html files in which
case
they are named .cgi to tell the web server to execute them as such.
Which method you use is determined by your web servers settings which could
have either or both enabled.
HTH,
Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld
More information about the Tutor
mailing list