Prasad, Ramit ramit.prasad at
Fri Jul 20 01:26:09 CEST 2012


You can use ast.literal_eval if you add an enclosing () or [] in the string 
(and add a finishing paren for the last tuple).

>the string is made with fors, using data from another file, and I need it as a tuplelist

If you are transferring this data (network/file) you may want to take a 
look at pickle/json. If you are doing this to convert to/from a CSV then look at
the csv module. If you say what are you trying to do and why, someone on the
list might be able to recommend a better way to do this.


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at  

More information about the Python-list mailing list