Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #25660
| Date | 2012-07-19 18:43 -0500 |
|---|---|
| From | Tim Chase <python.list@tim.thechases.com> |
| Subject | Re: help |
| References | <E11474306C04254C871D4C0B6AE5CA6F1E81F8BF@SN2PRD0202MB131.namprd02.prod.outlook.com> <5B80DD153D7D744689F57F4FB69AF47416582D8D@SCACMX008.exchad.jpmchase.net> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2326.1342741348.4697.python-list@python.org> (permalink) |
On 07/19/12 18:26, Prasad, Ramit wrote:
>> ('per1','persona1.1','pro1'),('per1','persona1.1','pro2'),('per1','persona1.1','pro3'),('per1','persona1.1','pro4'),('per1','persona1.1','pro5'),('per2','persona2.1','pro1'),('per2','persona2.1','pro2'),('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','persona2.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','persona2.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).
If you want a resulting tuple-of-tuple and you have at least one
comma after the first tuple, you don't even have to include the ()
around it.
-tkc
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: help Tim Chase <python.list@tim.thechases.com> - 2012-07-19 18:43 -0500
csiph-web