Collapse a list and eval ??
TAG
tonino.greco at gmail.com
Fri Oct 8 04:20:05 EDT 2004
More information about the Python-list mailing list
Fri Oct 8 04:20:05 EDT 2004
- Previous message (by thread): subclassing builtin types
- Next message (by thread): Collapse a list and eval ??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): subclassing builtin types
- Next message (by thread): Collapse a list and eval ??
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list