Problem with popen() and a regular expression

Simon Willison cs1spw at bath.ac.uk
Tue Mar 5 11:01:51 EST 2002


Joonas Paalasmaa wrote:
> 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.

I'm a Python newbie :) How does that makes things more secure?




More information about the Python-list mailing list