Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   RE: help (http://www.velocityreviews.com/forums/t948287-re-help.html)

Prasad, Ramit 07-19-2012 11:26 PM

RE: help
 
>('per1','persona1.1','pro1'),('per1','persona1.1' ,'pro2'),('per1','persona1.1','pro3'),('per1','per sona1.1','pro4'),('per1','persona1.1','pro5'),('pe r2','persona2.1','pro1'),('per2','persona2.1','pro 2'),('per2','persona2.1','pro3'),('per2','persona2 .1','pro4'),('per2','persona2.1','pro5'),('per2',' persona2.2','pro1'),('per2','persona2.2','pro2'),( 'per2','persona2.2','pro3'),('per2','persona2.2',' pro4'),('per2','persona2.2','pro5'),('per2','perso na2.3','pro1'),('per2','persona2.3','pro2'),('per2 ','persona2.3','pro3'),('per2','persona2.3','pro4' ),('per2','persona2.3','pro5'),('per2','persona2.4 ','pro1'),('per2','persona2.4','pro2'),('per2','pe rsona2.4','pro3'

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


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 http://www.jpmorgan.com/pages/disclosures/email.


All times are GMT. The time now is 08:31 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.