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

2005-08-10 Thread Mike Meyer
Jeff Schwab <[EMAIL PROTECTED]> writes: > Jerry He wrote: >> 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? > > >>> exec "b = lambda s: s*s" > >>> b Jeff forgot to w

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

2005-08-09 Thread Jeff Schwab
Jerry He wrote: > 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? >>> exec "b = lambda s: s*s" >>> b at 0x4d69cc> -- http://mail.python.org/mailman/listinfo/p

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

2005-08-09 Thread Jerry He
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