Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'string.': 0.05; 'true,': 0.05; 'subject:Python': 0.06; 'string': 0.09; 'subject:string': 0.09; 'question.': 0.14; "'b'": 0.16; "'c'": 0.16; "['a',": 0.16; 'appreciated!': 0.16; 'evaluating': 0.16; 'subject:variable': 0.16; 'basically': 0.19; 'to:name:python-list@python.org': 0.22; 'evaluation': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'maybe': 0.34; 'basic': 0.35; 'received:google.com': 0.35; 'var': 0.36; 'should': 0.36; 'list': 0.37; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:a 30': 0.61; 'name': 0.63; 'refer': 0.63; 'dict()': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=7PsiJSUce3J18Nby7lP/pW1UGxdtb+K6W6PrVJxANxI=; b=Km+oF34oNbyBPmGFBYyVRHSyA9feQ0xF8swMxv2NRxHd/lwDf4TajYcCTBMLo73CjV dvxeqyQvWYbqfLIiWgoFLA/hjr3skg1QnuuoFbc+pXWg5INdG0H9G3LLVavrY8R9gZlW NaKEJiIntsgmSwthrGdjTJkYcXCMU2SgXL8w0fhfRD68OIB+Iy/ATTFjlpfAkT22VhsZ YpZ6qTxAxoTqb6V4jc6ShvW2jLh9U8O1LYdxiCwTUMztZwhPRKn2rXdFvwcSLaV80ml1 5tq2HNmirEZuIa5rFBIrDDfJehgdlBM5uiSakDQYuHOjk8/JnnqeSaZDSXi64wXEYV6a 15AQ== X-Received: by 10.182.128.6 with SMTP id nk6mr19931158obb.11.1377258026440; Fri, 23 Aug 2013 04:40:26 -0700 (PDT) MIME-Version: 1.0 From: Jake Angulo Date: Fri, 23 Aug 2013 21:40:06 +1000 Subject: Python variable as a string To: "python-list@python.org" Content-Type: multipart/alternative; boundary=e89a8ff242a36e1f6e04e49bdf15 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 50 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1377258034 news.xs4all.nl 15959 [2001:888:2000:d::a6]:60118 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52879 --e89a8ff242a36e1f6e04e49bdf15 Content-Type: text/plain; charset=ISO-8859-1 Sorry this is a very basic question. I have a list *var* which after some evaluation I need to refer to *var* as a string. Pseudocode: var = ['a', 'b' , 'c' , 'd'] adict = dict(var='string', anothervar='anotherstring') anotherdict = dict() if : anotherdict[akey] = adict['var'] Basically im evaluating the list *var*, and if true, i want to use *var* as a string so that i can refer to a key-value pair in *adict *(whose key name is also var for convenience). * * Or maybe i should do things differently? Any help and code will be appreciated! --e89a8ff242a36e1f6e04e49bdf15 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Sorry this is a very basic question.

I have a list var which after some evaluation I need to ref= er to var as a string.

Pseudocode:

var =3D ['a', 'b' , 'c' , '= d']
adict =3D dict(var=3D'string', anothervar=3D'= anotherstring')
anotherdict =3D dict()
if <condi= tion>:
=A0 =A0 anotherdict[akey] =3D adict['var'] =A0=A0

Basically im evaluating the list var<= /b>, and if true, i want to use var as a string so that i can= refer to a key-value pair in adict (who= se key name is also var for convenience).

Or maybe i should do things differently?<= /div>

Any help and code will be appreciated!
--e89a8ff242a36e1f6e04e49bdf15--