Problem with popen() and a regular expression

Joonas Paalasmaa joonas at olen.to
Tue Mar 5 10:28:03 EST 2002


Simon Willison wrote:
> I've written a simple Python script to scan a bunch of URLs for "live" 
> sites and grab the title of those pages. It works by using popen() to 
> call lynx and analyse the HTTP response:
> 
> -----------------------------------------------------------------
> 
> command = "/opt/bin/lynx -mime_header http://www.bath.ac.uk/~"+user+"/"

Use:

command=["/opt/bin/lynx","-mime_header","http://www.bath.ac.uk/~"+user+"/"]

for better security.




More information about the Python-list mailing list