Is there a way of executing a command in a string?

Jerry He rebound1618 at yahoo.com
Tue Aug 9 22:55:39 EDT 2005


Hi, 
  suppose I have the following string

cmdstr = "b = lambda s: s*s"

  Is there a way to execute this string other than
copying it onto a file and then importing it? 

thanks in advance, 

Jerry

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Python-list mailing list