scanf in python...?

John W. Baxter jwbnews at scandaroon.com
Wed Oct 18 19:54:49 EDT 2000


In article <G2MsHE.KFx at world.std.com>, wware at world.std.com (Will Ware) 
wrote:

> Steve Clift (sgclift at earthlink.net) wrote:
> > ...the sscanf module I wrote about 5 years ago...
> 
> Whenever I need to do something like sscanf(), I use eval(). Is
> sscanfmodule.c much faster? It looks like a very good thing:
> http://www.python.org/ftp/python/contrib-09-Dec-1999/Misc/sscanfmodule.c

eval() is somewhat dangerous.  How dangerous depends upon where the 
strings come from, and what privilege the script is running with.  
Consider variations on "rm -rf /", "shutdown -h now", and friends.

That should mean that the sscanf module is better.

   --John

-- 
John W. Baxter   Port Ludlow, WA USA  jwbnews at scandaroon.com



More information about the Python-list mailing list