There is no such thing as a "cgi form" or "cgi window". Your cgi script runs when the user requests a Web page, generates a page, and then ends. At that point, python has stopped running. If your want the client's browser window to close, that's not a python problem. If you want to invalidate the download link after one successful download, you'll have to add a unique identifier to the url and keep track of which identifiers are still valid.
Thanks for responding, Technically cgi is a script. But a form is what a cgi script file can create. The form I asked about is html, it was generated by a cgi script file. So I should have written; a cgi script file generated html form, or a cgi script file generated html window. Lazy writing. My mistake. However I asked a question which now is mute. Once the user downloads the data the user can copy it, so why limit the download?. I appreciate the response, jd inqvista.com
-- https://mail.python.org/mailman/listinfo/python-list