'<!doctype html public "-// //dtd xhtml transitional//en" '\nb'\nb'<html xmlns=" '\nb'\nbecause this version uses urllib request interface that automatically saves the downloaded data in local fileit' similar to ftp downloads in spirit but this script must also somehow come up with local filename for storing the data you can either let the script strip and use the base filename from the constructed urlor explicitly pass local filename as last command-line argument in the prior runfor instancethe downloaded web page is stored in the local file index html in the current working directory--the base filename stripped from the url (the script prints the url and local filename as its first output linein the next runthe local filename is passed explicitly as py-index htmlc:\pp \internet\otherhttp-getfile-urllib py www python org /index html py-index html '<!doctype html public "-// //dtd xhtml transitional//en" '\nb'\nb'<html xmlns=" '\nb'\nc:\pp \internet\otherhttp-getfile-urllib py www rmi net /~lutz books html '\nb'\nb'\nb"mark lutz' book support site\nb'\nb'\nc:\pp \internet\otherhttp-getfile-urllib py www rmi net /~lutz/about-pp html '\nb'\nb'\nb'about "programming python"\nb'\nb'\ninvoking programs and escaping text the next listing shows this script being used to trigger remote program as beforeif you don' give the local filename explicitlythe script strips the base filename out of the filename argument that' not always easy or appropriate for program client-side scripting