Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25659

RE: help

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ramit.prasad@jpmorgan.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'completeness': 0.07; 'subject:help': 0.07; 'received:155': 0.09; 'file,': 0.15; '>the': 0.16; 'csv': 0.16; 'currencies': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:155.180.234': 0.16; 'received:159.53': 0.16; 'received:169.70': 0.16; 'received:169.70.184': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'why,': 0.16; 'string': 0.17; 'to:name :python-list@python.org': 0.20; 'trying': 0.21; 'received:169.254': 0.24; 'header:In-Reply-To:1': 0.25; 'accuracy': 0.27; 'module.': 0.27; 'chase': 0.29; 'convert': 0.29; 'received:169': 0.29; 'this.': 0.29; 'header:Received:8': 0.30; '(and': 0.32; 'to:addr:python-list': 0.33; 'another': 0.33; 'phone:': 0.34; 'list': 0.35; 'doing': 0.35; 'add': 0.36; 'charset :us-ascii': 0.36; 'data': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'information,': 0.63; 'url:email': 0.63; 'legal': 0.65; 'subject': 0.66; 'investment': 0.67; 'purchase': 0.67; 'sale': 0.76; 'bank': 0.77; '712': 0.84; 'paren': 0.84; 'received:169.254.8': 0.84; 'to/from': 0.84; 'houston,': 0.91
X-DKIM OpenDKIM Filter v2.1.3 sz4.jpmchase.com q6JNQJ1a025157
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1342740379; bh=iQYbCc/SaGujS4a4Cc4JtCBynjDNbPFLT7xQJrR+7Ck=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=g/RO9BLlAJBFhQyMeN+bHrCFQTHM02F0xy8853QJJ5EXmX8/aRBWwXeTxArNZ5pe+ IDiTFfQjg1pqm7/5smbBkUYv326HF1t/LhTChJ2haHsaeYW26PfqPqwYbLdt0SiJaa GP4v7dHoUB7mH6rMI2+vkEhX0JAIFPvMrwajk7us=
From "Prasad, Ramit" <ramit.prasad@jpmorgan.com>
To "python-list@python.org" <python-list@python.org>
Subject RE: help
Thread-Topic help
Thread-Index Ac1l/ccXsR/LnrBwT2SHDfHDHo52HAAB1f3w
Date Thu, 19 Jul 2012 23:26:09 +0000
References <E11474306C04254C871D4C0B6AE5CA6F1E81F8BF@SN2PRD0202MB131.namprd02.prod.outlook.com>
In-Reply-To <E11474306C04254C871D4C0B6AE5CA6F1E81F8BF@SN2PRD0202MB131.namprd02.prod.outlook.com>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [10.67.79.47]
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
X-DLP-FWD Yes
Content-Type text/plain; charset="us-ascii"
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2325.1342741039.4697.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1342741039 news.xs4all.nl 6964 [2001:888:2000:d::a6]:50484
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:25659

Show key headers only | View raw


>('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).

>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.  

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

RE: help  "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-07-19 23:26 +0000

csiph-web