query parameters at the end for remote program invocation given script invocation url and no explicit output filenamethe script extracts the base filename in the middle by using first the standard urllib parse module to pull out the file pathand then os path split to strip off the directory path howeverthe resulting filename is remote script' nameand it may or may not be an appropriate place to store the data locally in the first run that followsfor examplethe script' output goes in local file called languages pythe script name in the middle of the urlin the secondwe instead name the output cxxsyntax html explicitly to suppress filename extractionc:\pp \internet\otherpython http-getfile-urllib py localhost /cgi-bin/languages py?language=scheme 'languages\nb'syntax\nb'scheme\nb(display "hello world"(newline\nb'\nb'\nc:\pp \internet\otherpython http-getfile-urllib py localhost /cgi-bin/languages py?language= +cxxsyntax html 'languages\nb'syntax\nb' \nb"sorry-- don' know that language\nb'\nb'\nthe remote script returns not-found message when passed " ++in the last command here it turns out that "+is special character in url strings (meaning space)and to be robustboth of the urllib scripts we've just written should really run the filename string through something called urllib parse quotea tool that escapes special characters for transmission we will talk about this in depth in so consider this preview for now but to make this invocation workwe need to use special sequences in the constructed url here' how to do it by handc:\pp \internet\otherpython http-getfile-urllib py localhost /cgi-bin/languages py?language= % % cxxsyntax html 'languages\nb'syntax\nb' ++\nbcout &lt;&lt"hello world&lt;&ltendl\nb'\nb'\nthe odd % strings in this command line are not entirely magicalthe escaping required for urls can be seen by running standard python tools manually--this is what these the urllib package revisited