Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Collapse a list and eval ??

Reply
Thread Tools

Collapse a list and eval ??

 
 
TAG
Guest
Posts: n/a
 
      10-08-2004
HI,

If I have a list :

data=['round', '(', '(', 12345, '*', '-', '0.0025', ')', ',', '2', ')', '']

how can I collapse it so that it becomes:
data_collapsed=['round((12345*-0.0025),2)']

and then run an eval() on it ?

Am I doing this the right way ?

Thanks
Tonino
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expand/Collapse script expands but does not collapse M.L. Javascript 9 08-29-2007 08:49 PM
DataBinder.Eval and Eval. craigkenisston@hotmail.com ASP .Net 1 06-16-2006 05:33 PM
Why does Gridview ALWAYS emit style="border-collapse: collapse;" Tom Castiglia ASP .Net Web Controls 2 06-09-2006 03:18 AM
How can I avoid border-collapse:collapse to come ... VVSRKS ASP .Net Datagrid Control 0 09-16-2004 10:13 AM
datagrid and border-collapse:collapse style Vaclav Jedlicka ASP .Net 1 06-30-2003 03:31 AM



Advertisments