Downloading Python files
adam6No_Spam_Please at speedy.co.il
Sat Jul 26 00:20:55 CEST 2003
Luke StClair wrote:
> Only marginally belonging in this newsgroup... but oh well.
> I've just started writing in python, and I want to make the files
> available on the web. So I did the standard <a
> href="mypath/myfile.py"> and not surprisingly, it displays like a
> webpage, but just the code. If I gzip it, and then link to the new
> file, it will download, but its so small I don't want it zipped.
> How can I make this into a downloadable
> file SIMPLY? The other thread seems a bit complicated...
In order to assure that the file is downloaded and not displayed, you
need a certain amount of control either at the client agent or the server:
1. Server: you need to be able to send the client a header which is
intended for download rather than display (content-type not set to
2. Client: you need to be able to tell the client agent to download the
data and save it as file on the disk ("Save targer as...") rather than
More information about the Python-list